From 7719453fb73d66181508bf44e3abf104c3e71be9 Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Mon, 28 Jun 2021 14:25:26 +0800 Subject: [PATCH] DEV: Don't eager load tags when tagging is not enabled. --- lib/topic_query.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/topic_query.rb b/lib/topic_query.rb index d09701fae7a..d296fc8f480 100644 --- a/lib/topic_query.rb +++ b/lib/topic_query.rb @@ -586,7 +586,8 @@ class TopicQuery options = @options options.reverse_merge!(per_page: per_page_setting) - result = Topic.includes(:tags, :allowed_users) + result = Topic.includes(:allowed_users) + result = result.includes(:tags) if SiteSetting.tagging_enabled if type == :group result = result.joins(