use simple_form and hash updates
This commit is contained in:
@ -59,6 +59,7 @@ module Merged
|
||||
end
|
||||
|
||||
def update(hash)
|
||||
return unless 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
|
||||
@ -70,6 +71,12 @@ module Merged
|
||||
end
|
||||
end
|
||||
|
||||
def update_options( options )
|
||||
return unless options
|
||||
option_definitions.each do |option|
|
||||
set_option(option.name, options[option.name])
|
||||
end
|
||||
end
|
||||
#other may be nil
|
||||
def swap_index_with(other)
|
||||
return unless other
|
||||
|
Reference in New Issue
Block a user