From 17dda6640005dbf630902e371ea74ccd1fa6f6ea Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 1 Aug 2017 17:25:54 +0900 Subject: [PATCH] PERF: N+1 queries when loading categories with featured topics. --- plugin.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugin.rb b/plugin.rb index 9388a8d..355453d 100644 --- a/plugin.rb +++ b/plugin.rb @@ -417,4 +417,8 @@ SQL TopicList.preloaded_custom_fields << "accepted_answer_post_id" if TopicList.respond_to? :preloaded_custom_fields + if CategoryList.respond_to?(:preloaded_topic_custom_fields) + CategoryList.preloaded_topic_custom_fields << "accepted_answer_post_id" + end + end