section move to other page
This commit is contained in:
@ -33,6 +33,10 @@ module Merged
|
||||
end
|
||||
end
|
||||
|
||||
def allowed_fields
|
||||
super + [:page_id]
|
||||
end
|
||||
|
||||
def has_cards?
|
||||
template_style.has_cards?
|
||||
end
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user