mirror of
https://github.com/discourse/discourse.git
synced 2025-02-04 22:29:44 +08:00
FIX: Preload the right fields on categories (#25213)
Co-authored-by: Daniel Waterworth <me@danielwaterworth.com>
This commit is contained in:
parent
26e07fa051
commit
75772910c4
|
@ -161,12 +161,11 @@ module Chat
|
|||
end
|
||||
|
||||
def self.preload_custom_fields_for(channels)
|
||||
preload_fields = Category.instance_variable_get(:@custom_field_types).keys
|
||||
Category.preload_custom_fields(
|
||||
channels
|
||||
.select { |c| c.chatable_type == "Category" || c.chatable_type == "category" }
|
||||
.map(&:chatable),
|
||||
preload_fields,
|
||||
Site.preloaded_category_custom_fields,
|
||||
)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user