mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Preload user-specific category fields (#25663)
This is used when lazy_load_categories is enabled to fetch more info about the category.
This commit is contained in:
@@ -240,7 +240,11 @@ class Category < ActiveRecord::Base
|
||||
|
||||
# Categories with children
|
||||
with_children =
|
||||
Category.where(parent_category_id: category_ids).pluck(:parent_category_id).to_set
|
||||
Category
|
||||
.secured(@guardian)
|
||||
.where(parent_category_id: category_ids)
|
||||
.pluck(:parent_category_id)
|
||||
.to_set
|
||||
|
||||
# Update category attributes
|
||||
categories.each do |category|
|
||||
|
||||
Reference in New Issue
Block a user