From 0bc568f66d88005fad94eb351a1cbb48375e91c3 Mon Sep 17 00:00:00 2001 From: Daniel Waterworth Date: Wed, 15 Nov 2023 16:34:03 -0600 Subject: [PATCH] FIX: Preload the right fields on categories (#24396) --- plugins/chat/lib/chat/channel_fetcher.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/chat/lib/chat/channel_fetcher.rb b/plugins/chat/lib/chat/channel_fetcher.rb index e0fd9986356..9daaf6908f1 100644 --- a/plugins/chat/lib/chat/channel_fetcher.rb +++ b/plugins/chat/lib/chat/channel_fetcher.rb @@ -171,12 +171,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