refactor: use type: Hash for page_settings (coercion in couch_potato)

This commit is contained in:
BenClaw
2026-05-30 20:43:25 +02:00
parent 548a227617
commit 24415b64c0
+1 -7
View File
@@ -21,13 +21,7 @@ module Cmtool
klass.property :active, type: :boolean, default: true
klass.property :layout
klass.property :in_menu, type: :boolean, default: true
klass.property :page_settings, default: {}
# Parse JSON string from form submission
klass.send(:define_method, :page_settings=) do |val|
val = JSON.parse(val) if val.is_a?(String)
super(val)
end
klass.property :page_settings, type: Hash, default: {}
klass.has_ancestry by_property: :locale