mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 03:16:41 +08:00
FIX: n+1 queries in CategoryList
This commit is contained in:
parent
4cd5ccdf1f
commit
46d1c8c1e0
|
@ -54,7 +54,7 @@ class CategoryList
|
|||
# Find a list of all categories to associate the topics with
|
||||
def find_categories
|
||||
@categories = Category
|
||||
.includes(:featured_users)
|
||||
.includes(:featured_users, subcategories: [:topic_only_relative_url])
|
||||
.secured(@guardian)
|
||||
.order('position asc')
|
||||
.order('COALESCE(categories.posts_week, 0) DESC')
|
||||
|
|
Loading…
Reference in New Issue
Block a user