module Her::Model::ORM::UpdateMethods

Public Instance Methods

update_attribute(attribute, value) click to toggle source

Update resource attribute

@example Update resource attribute

@user = User.find(1)
# Fetched via GET "/users/1"
@user.update_attributes(:fullname, "Tobias Fünke")
# Called via PUT "/users/1"
# 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) click to toggle source
# File lib/her/model/orm/update_methods.rb, line 19
def update_attributes(attributes)
  self.data.merge!(attributes)
  save
end
update_attributes!(attributes) click to toggle source
# File lib/her/model/orm/update_methods.rb, line 24
def update_attributes!(attributes)
  self.data.merge!(attributes)
  save!
end