mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 14:03:22 +08:00
fb0e656cb7
Why this change? One Ruby class per file improves readability
18 lines
413 B
Ruby
18 lines
413 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ThemeSettingsManager::Objects < ThemeSettingsManager
|
|
def value
|
|
has_record? ? db_record.json_value : default.map!(&:deep_stringify_keys)
|
|
end
|
|
|
|
def value=(objects)
|
|
# TODO: Validate the objects against the schema
|
|
|
|
record = has_record? ? db_record : create_record!
|
|
record.json_value = objects
|
|
record.save!
|
|
theme.reload
|
|
record.json_value
|
|
end
|
|
end
|