mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 17:52:45 +08:00
Merge pull request #2782 from riking/topic-query-perf
PERF: Tame eager-loading of category definition topic
This commit is contained in:
commit
7ea7ab80ac
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user