0
0
Fork 0

Fix instance actor being incorrectly created when running migrations (#18109)

* Add migration test about instance actor key

* Fix old migration

* Work around incorrect database state
This commit is contained in:
Claire 2022-04-26 21:22:09 +02:00 committed by GitHub
parent f47a9ddc9f
commit 33cd80d69c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 1 deletions

View file

@ -559,6 +559,12 @@ class Account < ApplicationRecord
before_validation :prepare_username, on: :create
before_destroy :clean_feed_manager
def ensure_keys!
return unless local? && private_key.blank? && public_key.blank?
generate_keys
save!
end
private
def prepare_contents