Fix N+1s because of association preloaders not actually getting called (#28339)
This commit is contained in:
parent
3f1ec16377
commit
dcc24db793
7 changed files with 12 additions and 12 deletions
|
@ -218,7 +218,7 @@ class AccountSearchService < BaseService
|
|||
|
||||
records = query_builder.build.limit(limit_for_non_exact_results).offset(offset).objects.compact
|
||||
|
||||
ActiveRecord::Associations::Preloader.new(records: records, associations: :account_stat)
|
||||
ActiveRecord::Associations::Preloader.new(records: records, associations: [:account_stat, { user: :role }]).call
|
||||
|
||||
records
|
||||
rescue Faraday::ConnectionFailed, Parslet::ParseFailed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue