Method: ActiveResource::Base#update_attribute

Defined in:
lib/active_resource/base.rb

#update_attribute(name, value) ⇒ Object

Updates a single attribute and then saves the object.

Note: Unlike ActiveRecord::Base.update_attribute, this method is subject to normal validation routines as an update sends the whole body of the resource in the request. (See Validations).

As such, this method is equivalent to calling update_attributes with a single attribute/value pair.

If the saving fails because of a connection or remote service error, an exception will be raised. If saving fails because the resource is invalid then false will be returned.



1416
1417
1418
1419
# File 'lib/active_resource/base.rb', line 1416

def update_attribute(name, value)
  self.send("#{name}=".to_sym, value)
  self.save
end