mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 15:54:23 +08:00
FIX: N+1 in topic_list
This commit is contained in:
parent
a702330ccd
commit
53ec4c44f4
|
@ -101,6 +101,7 @@ class TopicList
|
|||
end
|
||||
|
||||
avatar_lookup = AvatarLookup.new(user_ids)
|
||||
primary_group_lookup = PrimaryGroupLookup.new(user_ids)
|
||||
|
||||
@topics.each do |ft|
|
||||
ft.user_data = @topic_lookup[ft.id] if @topic_lookup.present?
|
||||
|
@ -111,7 +112,7 @@ class TopicList
|
|||
|
||||
ft.posters = ft.posters_summary(
|
||||
avatar_lookup: avatar_lookup,
|
||||
primary_group_lookup: PrimaryGroupLookup.new(user_ids)
|
||||
primary_group_lookup: primary_group_lookup
|
||||
)
|
||||
|
||||
ft.participants = ft.participants_summary(avatar_lookup: avatar_lookup, user: @current_user)
|
||||
|
|
Loading…
Reference in New Issue
Block a user