mirror of
https://github.com/discourse/discourse.git
synced 2025-01-31 06:09:30 +08:00
PERF: use preloader trick to load topic categories
This commit is contained in:
parent
c059352484
commit
6f7a89dcaa
|
@ -115,7 +115,8 @@ class CategoryList
|
||||||
topics_in_cat.each do |topic_id|
|
topics_in_cat.each do |topic_id|
|
||||||
topic = @topics_by_id[topic_id]
|
topic = @topics_by_id[topic_id]
|
||||||
if topic.present? && @guardian.can_see?(topic)
|
if topic.present? && @guardian.can_see?(topic)
|
||||||
topic.category = c
|
# topic.category is very slow under rails 4.2
|
||||||
|
topic.association(:category).target = c
|
||||||
c.displayable_topics << topic
|
c.displayable_topics << topic
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user