mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
BUGFIX: remove N+1 on topic lists
This commit is contained in:
parent
5f2c2efb47
commit
b018b4ad18
1 changed files with 5 additions and 1 deletions
|
@ -22,7 +22,11 @@ class TopicList
|
|||
|
||||
# copy side-loaded data (allowed users) before dumping it with the .to_a
|
||||
@topics_input.each do |t|
|
||||
t.allowed_user_ids = t.allowed_users.map { |u| u.id }.to_a
|
||||
t.allowed_user_ids = if @filter == :private_messages
|
||||
t.allowed_users.map { |u| u.id }.to_a
|
||||
else
|
||||
[]
|
||||
end
|
||||
end
|
||||
|
||||
@topics = @topics_input.to_a
|
||||
|
|
Loading…
Reference in a new issue