|
@@ -122,7 +122,7 @@ module AccountSearch
|
|
|
tsquery = generate_query_for_search(terms)
|
|
|
|
|
|
find_by_sql([BASIC_SEARCH_SQL, { limit: limit, offset: offset, tsquery: tsquery }]).tap do |records|
|
|
|
- ActiveRecord::Associations::Preloader.new(records: records, associations: :account_stat)
|
|
|
+ ActiveRecord::Associations::Preloader.new(records: records, associations: [:account_stat, { user: :role }]).call
|
|
|
end
|
|
|
end
|
|
|
|
|
@@ -131,7 +131,7 @@ module AccountSearch
|
|
|
sql_template = following ? ADVANCED_SEARCH_WITH_FOLLOWING : ADVANCED_SEARCH_WITHOUT_FOLLOWING
|
|
|
|
|
|
find_by_sql([sql_template, { id: account.id, limit: limit, offset: offset, tsquery: tsquery }]).tap do |records|
|
|
|
- ActiveRecord::Associations::Preloader.new(records: records, associations: :account_stat)
|
|
|
+ ActiveRecord::Associations::Preloader.new(records: records, associations: [:account_stat, { user: :role }]).call
|
|
|
end
|
|
|
end
|
|
|
|