mirror of
https://github.com/discourse/discourse.git
synced 2026-08-10 04:58:31 -05:00
DEV: Validate objects when updating typed objects theme settings (#25902)
Why this change? This change ensures that we validate the value of the new objects when updating typed objects theme settings.
This commit is contained in:
@@ -6,7 +6,7 @@ class ThemeSettingsManager::Objects < ThemeSettingsManager
|
||||
end
|
||||
|
||||
def value=(objects)
|
||||
# TODO: Validate the objects against the schema
|
||||
ensure_is_valid_value!(objects)
|
||||
|
||||
record = has_record? ? db_record : create_record!
|
||||
record.json_value = objects
|
||||
|
||||
@@ -61,7 +61,7 @@ class ThemeSettingsObjectValidator
|
||||
end
|
||||
|
||||
def initialize(schema:, object:, json_pointer_prefix: "", errors: {}, valid_ids_lookup: {})
|
||||
@object = object
|
||||
@object = object.with_indifferent_access
|
||||
@schema_name = schema[:name]
|
||||
@properties = schema[:properties]
|
||||
@errors = errors
|
||||
|
||||
Reference in New Issue
Block a user