Eager loading fixes for api/ controllers (#28848)

This commit is contained in:
Matt Jankowski 2024-01-23 06:41:54 -05:00 committed by GitHub
commit c0e8e457ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 14 additions and 14 deletions

View file

@ -29,7 +29,7 @@ class AccountSuggestions
# a complicated query on this end.
account_ids = account_ids_with_sources[offset, limit]
accounts_map = Account.where(id: account_ids.map(&:first)).includes(:account_stat).index_by(&:id)
accounts_map = Account.where(id: account_ids.map(&:first)).includes(:account_stat, :user).index_by(&:id)
account_ids.filter_map do |(account_id, source)|
next unless accounts_map.key?(account_id)