eager load more tables for the topic_view

This commit is contained in:
Régis Hanol 2017-08-04 17:23:53 +02:00
parent c26ba890bd
commit c76161787c
1 changed files with 1 additions and 1 deletions

View File

@ -387,7 +387,7 @@ class TopicView
def filter_posts_by_ids(post_ids)
# TODO: Sort might be off
@posts = Post.where(id: post_ids, topic_id: @topic.id)
.includes(:user, :reply_to_user, :incoming_email)
.includes({ user: :primary_group }, :reply_to_user, :deleted_by, :incoming_email, :topic)
.order('sort_order')
@posts = filter_post_types(@posts)
@posts = @posts.with_deleted if @guardian.can_see_deleted_posts?