diff --git a/plugins/chat/lib/chat/channel_fetcher.rb b/plugins/chat/lib/chat/channel_fetcher.rb index 61112b5e3e3..59ff5690eb6 100644 --- a/plugins/chat/lib/chat/channel_fetcher.rb +++ b/plugins/chat/lib/chat/channel_fetcher.rb @@ -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