mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
remove N+1 queries
This commit is contained in:
@@ -196,7 +196,7 @@ class TopicQuery
|
||||
end
|
||||
end
|
||||
|
||||
result = result.listable_topics.includes(:category)
|
||||
result = result.listable_topics.includes(:category => :topic_only_relative_url)
|
||||
result = result.where('categories.name is null or categories.name <> ?', query_opts[:exclude_category]) if query_opts[:exclude_category]
|
||||
result = result.where('categories.name = ?', query_opts[:only_category]) if query_opts[:only_category]
|
||||
result = result.limit(page_size) unless query_opts[:limit] == false
|
||||
|
||||
Reference in New Issue
Block a user