Method: ModelPack::AttributeMethods#update_attributes!
- Defined in:
- lib/model_pack/attribute_methods.rb
#update_attributes!(attributes) ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/model_pack/attribute_methods.rb', line 31 def update_attributes!(attributes) # check present first attributes.each do |name, attribute| raise ArgumentError, "undefined attribute `#{name}`" unless attribute_names.include?(method) key = "#{name}=" send(key, attribute) if respond_to?(key) end end |