diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-04-27 09:30:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-27 09:30:49 +0200 |
commit | fbe212de6a599a90411d5a80d4fb00d2d6ca9041 (patch) | |
tree | 43038bf3550f8f162495dfc8d9cc077ad1da4052 /db/migrate | |
parent | a481af15a9b2a7829c2a849906aa4b475ccdbd98 (diff) | |
parent | fc1dd81ea50e3a12ce6a298103a94d2f5445d7d2 (diff) |
Merge pull request #1752 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20190715164535_add_instance_actor.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/db/migrate/20190715164535_add_instance_actor.rb b/db/migrate/20190715164535_add_instance_actor.rb index 8c0301d69..0ae53199a 100644 --- a/db/migrate/20190715164535_add_instance_actor.rb +++ b/db/migrate/20190715164535_add_instance_actor.rb @@ -2,6 +2,14 @@ class AddInstanceActor < ActiveRecord::Migration[5.2] class Account < ApplicationRecord # Dummy class, to make migration possible across version changes validates :username, uniqueness: { scope: :domain, case_sensitive: false } + + before_create :generate_keys + + def generate_keys + keypair = OpenSSL::PKey::RSA.new(2048) + self.private_key = keypair.to_pem + self.public_key = keypair.public_key.to_pem + end end def up |