Module: Her::Model::ORM::UpdateMethods
- Extended by:
- ActiveSupport::Concern
- Included in:
- Her::Model::ORM
- Defined in:
- lib/her/model/orm/update_methods.rb
Instance Method Summary collapse
-
#update_attribute(attribute, value) ⇒ Object
Update resource attribute.
- #update_attributes(attributes) ⇒ Object
- #update_attributes!(attributes) ⇒ Object
Instance Method Details
#update_attribute(attribute, value) ⇒ Object
Update resource attribute
14 15 16 17 |
# File 'lib/her/model/orm/update_methods.rb', line 14 def update_attribute(attribute, value) send(attribute.to_s + '=', value) save end |
#update_attributes(attributes) ⇒ Object
19 20 21 22 |
# File 'lib/her/model/orm/update_methods.rb', line 19 def update_attributes(attributes) self.data.merge!(attributes) save end |
#update_attributes!(attributes) ⇒ Object
24 25 26 27 |
# File 'lib/her/model/orm/update_methods.rb', line 24 def update_attributes!(attributes) self.data.merge!(attributes) save! end |