From 6f7a89dcaac0da192e76e674c9b1644e45427bdb Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 17 Nov 2014 16:57:52 +1100 Subject: [PATCH] PERF: use preloader trick to load topic categories --- app/models/category_list.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/category_list.rb b/app/models/category_list.rb index 421dac576cf..b7868cdb0f8 100644 --- a/app/models/category_list.rb +++ b/app/models/category_list.rb @@ -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