mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
FIX: n+1 queries in CategoryList
This commit is contained in:
parent
4cd5ccdf1f
commit
46d1c8c1e0
1 changed files with 1 additions and 1 deletions
|
@ -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 a new issue