section move to other page

This commit is contained in:
2023-01-20 15:40:41 +02:00
parent 8d650a82cc
commit d6dd0fd589
9 changed files with 30 additions and 31 deletions

View File

@ -33,6 +33,10 @@ module Merged
end
end
def allowed_fields
super + [:page_id]
end
def has_cards?
template_style.has_cards?
end

View File

@ -58,14 +58,16 @@ module Merged
end
end
def update(key , value)
raise "unsuported field #{key} for #{template}" unless allowed_fields.include?(key)
if(! attributes[key].nil? ) # first setting ok, types not (yet?) specified
if( @attributes[key].class != value.class )
raise "Type mismatch #{key} #{key.class}!=#{value.class}"
def update(hash)
hash.each do |key , value|
raise "unsuported field #{key} for #{template}:#{allowed_fields}" unless allowed_fields.include?(key.to_sym)
if(! attributes[key].nil? ) # first setting ok, types not (yet?) specified
if( @attributes[key].class != value.class )
raise "Type mismatch #{key} #{key.class}!=#{value.class}"
end
end
attributes[key] = value
end
attributes[key] = value
end
#other may be nil