FIX: Always include custom fields in CategorySerializer

FIX: Always include custom fields in CategorySerializer

even if it is empty

diff --git a/app/serializers/category_serializer.rb b/app/serializers/category_serializer.rb
index 1621397..d7973eb 100644
--- a/app/serializers/category_serializer.rb
+++ b/app/serializers/category_serializer.rb
@@ -102,4 +102,8 @@ class CategorySerializer < BasicCategorySerializer
   def custom_fields
     object.custom_fields
   end
+
+  def include_custom_fields?
+    true
+  end
 end
diff --git a/spec/serializers/category_serializer_spec.rb b/spec/serializers/category_serializer_spec.rb
index 8f5a286..05d89c1 100644
--- a/spec/serializers/category_serializer_spec.rb
+++ b/spec/serializers/category_serializer_spec.rb
@@ -5,6 +5,9 @@ describe CategorySerializer do
   let(:category) { Fabricate(:category) }
 
   it "includes custom fields" do
+    json = described_class.new(category, scope: Guardian.new, root: false).as_json
+    expect(json[:custom_fields]).to be_empty
+
     category.custom_fields["enable_marketplace"] = true
     category.save_custom_fields

GitHub sha: b8bd0316

This commit has been mentioned on Discourse Meta. There might be relevant details there:

DEV: Update JS test fixtures