PERF: use preloader trick to load topic categories

This commit is contained in:
Sam 2014-11-17 16:57:52 +11:00
parent c059352484
commit 6f7a89dcaa

View file

@ -115,7 +115,8 @@ class CategoryList
topics_in_cat.each do |topic_id|
topic = @topics_by_id[topic_id]
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
end
end