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
1 changed files with 2 additions and 1 deletions

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