DEV: Deprecate array custom fields (#24492)

Array custom fields use separate rows for each value, but whenever we
update an array, we have always destroy the existing rows and create new
ones. Therefore, there's no benefit over using the json type.
This commit is contained in:
Daniel Waterworth 2023-11-21 11:05:49 -06:00 committed by GitHub
parent b3c67a78b8
commit ced21fa5c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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