Preload custom user fields when viewing flag queue

This commit is contained in:
Robin Ward
2018-06-12 16:17:22 -04:00
parent fc973f9363
commit 5bd1c5cc95
2 changed files with 21 additions and 2 deletions

View File

@ -129,10 +129,13 @@ module FlagQuery
# TODO: add serializer so we can skip this
posts.map!(&:marshal_dump)
users = User.includes(:user_stat).where(id: user_ids.to_a).to_a
User.preload_custom_fields(users, User.whitelisted_user_custom_fields(guardian))
[
posts,
Topic.with_deleted.where(id: topic_ids.to_a).to_a,
User.includes(:user_stat).where(id: user_ids.to_a).to_a,
users,
all_post_actions,
total_rows
]