mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:39:30 +08:00
eager load more tables for the topic_view
This commit is contained in:
@ -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?
|
||||
|
Reference in New Issue
Block a user