Skip to content

Commit 74c1416

Browse files
authored
Merge pull request #1844 from codidact/art/tag-page-performance
Resolve N+1 on community_user
2 parents 24a68a4 + 62885cd commit 74c1416

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/models/post.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class Post < ApplicationRecord
5353
scope :list_includes, lambda {
5454
includes(:user, :tags, :post_type, :category, :community, :last_activity_by,
5555
category: [:moderator_tags, :required_tags, :topic_tags],
56-
user: :avatar_attachment)
56+
user: [:avatar_attachment, :community_user])
5757
}
5858
scope :has_duplicates, -> { joins(:inbound_duplicates) } # uses INNER JOIN by default so no where required
5959

0 commit comments

Comments
 (0)