Skip to content

A platform for community discussion. Free, open, simple.

DEV: Deprecate array custom fields (#24492)

Daniel Waterworthced21fa5c149
diff --git a/app/models/concerns/has_custom_fields.rb b/app/models/concerns/has_custom_fields.rb
index e543d8c97ed..56026d9eab8 100644
--- a/app/models/concerns/has_custom_fields.rb
+++ b/app/models/concerns/has_custom_fields.rb
@@ -87,6 +87,13 @@ module HasCustomFields
end
def register_custom_field_type(name, type)
+ if Array === type
+ Discourse.deprecate(
+ "Array types for custom fields are deprecated, use type :json instead",
+ drop_from: "3.3.0",
+ )
+ end
+
@custom_field_types ||= {}
@custom_field_types[name] = type
end