about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorabcang <abcang1015@gmail.com>2019-10-01 00:02:03 +0900
committerEugen Rochko <eugen@zeonfederated.com>2019-09-30 17:02:03 +0200
commit9ef5532a7ece064ee76bb345abef03bbd6b64418 (patch)
treed3b70720b2dcdddda8ede3ca73524d8292383ad6 /app/services
parent3babf8464b0903b854ec16d355909444ef3ca0bc (diff)
Fix follow requests N+1 (#12004)
Diffstat (limited to 'app/services')
-rw-r--r--app/services/update_account_service.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/services/update_account_service.rb b/app/services/update_account_service.rb
index ebf24be37..4172d5774 100644
--- a/app/services/update_account_service.rb
+++ b/app/services/update_account_service.rb
@@ -21,7 +21,7 @@ class UpdateAccountService < BaseService
 
   def authorize_all_follow_requests(account)
     follow_requests = FollowRequest.where(target_account: account)
-    follow_requests = follow_requests.select { |req| !req.account.silenced? }
+    follow_requests = follow_requests.preload(:account).select { |req| !req.account.silenced? }
     AuthorizeFollowWorker.push_bulk(follow_requests) do |req|
       [req.account_id, req.target_account_id]
     end