Method: Dynamoid::Fields#update_attributes

Defined in:
lib/dynamoid/fields.rb

#update_attributes(attributes) ⇒ Object

Updates multiple attibutes at once, saving the object once the updates are complete.

Parameters:

  • attributes (Hash)

    a hash of attributes to update

Since:

  • 0.2.0



139
140
141
142
# File 'lib/dynamoid/fields.rb', line 139

def update_attributes(attributes)
  attributes.each {|attribute, value| self.write_attribute(attribute, value)} unless attributes.nil? || attributes.empty?
  save
end