about summary refs log tree commit diff
path: root/app/models/concerns
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-04-26 21:22:09 +0200
committerGitHub <noreply@github.com>2022-04-26 21:22:09 +0200
commit33cd80d69c1491ff70ce9191113763c76cb7e6b7 (patch)
treeb55d22d4f0e260b601b70fc790f8e4c49f7da751 /app/models/concerns
parentf47a9ddc9ffca22258ec9e4b12ca51db8cac1eac (diff)
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
Diffstat (limited to 'app/models/concerns')
-rw-r--r--app/models/concerns/account_finder_concern.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/concerns/account_finder_concern.rb b/app/models/concerns/account_finder_concern.rb
index 0dadddad1..e8b804934 100644
--- a/app/models/concerns/account_finder_concern.rb
+++ b/app/models/concerns/account_finder_concern.rb
@@ -13,7 +13,7 @@ module AccountFinderConcern
     end
 
     def representative
-      Account.find(-99)
+      Account.find(-99).tap(&:ensure_keys!)
     rescue ActiveRecord::RecordNotFound
       Account.create!(id: -99, actor_type: 'Application', locked: true, username: Rails.configuration.x.local_domain)
     end