move cards
This commit is contained in:
@ -38,6 +38,10 @@ module Merged
|
||||
CardStyle.find_by_template( self.template )
|
||||
end
|
||||
|
||||
def allowed_fields
|
||||
super + [:section_id]
|
||||
end
|
||||
|
||||
def delete_and_reset_index(editor)
|
||||
delete_save!(editor)
|
||||
section.reset_index
|
||||
|
@ -61,12 +61,15 @@ module Merged
|
||||
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)
|
||||
value = value.to_i if key.to_s.include?("_id")
|
||||
key = key.to_sym
|
||||
raise "unsuported field #{key} for #{template}:#{allowed_fields}" 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}"
|
||||
raise "Type mismatch #{key} #{@attributes[key].class}!=#{value.class}"
|
||||
end
|
||||
end
|
||||
puts "setting #{key}=#{value}"
|
||||
attributes[key] = value
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user