Merge pull request #2782 from riking/topic-query-perf

PERF: Tame eager-loading of category definition topic
This commit is contained in:
Sam 2014-09-11 13:14:05 +10:00
commit 7ea7ab80ac

View File

@ -246,7 +246,7 @@ class TopicQuery
end
result = apply_ordering(result, options)
result = result.listable_topics.includes(category: :topic_only_relative_url)
result = result.listable_topics.includes(:category)
result = result.where('categories.name is null or categories.name <> ?', options[:exclude_category]).references(:categories) if options[:exclude_category]
# Don't include the category topics if excluded