mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Allow setting max_length for field types using the plugin API (#24635)
This commit is contained in:
committed by
GitHub
parent
384a8b17a1
commit
eef93ac926
@@ -114,7 +114,9 @@ module HasCustomFields
|
||||
get_custom_field_descriptor(key).append_field(target, key, value)
|
||||
end
|
||||
|
||||
def register_custom_field_type(name, type, max_length: DEFAULT_FIELD_DESCRIPTOR.max_length)
|
||||
def register_custom_field_type(name, type, max_length: nil)
|
||||
max_length ||= DEFAULT_FIELD_DESCRIPTOR.max_length
|
||||
|
||||
if Array === type
|
||||
Discourse.deprecate(
|
||||
"Array types for custom fields are deprecated, use type :json instead",
|
||||
|
||||
Reference in New Issue
Block a user