mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Error not being raised for required typed categories property (#26443)
Why this change? For a schema like this: ``` schema = { name: "section", properties: { category_property: { type: "categories", required: true, }, }, } ``` When the value of the property is set to an empty array, we are not raising an error which we should because the property is marked as required.
This commit is contained in:
committed by
GitHub
parent
6cfeb62c29
commit
a84757fd91
@@ -208,7 +208,7 @@ class ThemeSettingsObjectValidator
|
||||
end
|
||||
|
||||
def is_property_present?(property_name)
|
||||
if @object[property_name].nil?
|
||||
if @object[property_name].blank?
|
||||
add_error(property_name, :required)
|
||||
false
|
||||
else
|
||||
|
Reference in New Issue
Block a user