--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Updates an object (or multiple objects) and saves it to the database, if validations pass. The resulting object is returned whether the object was saved successfully to the database or not.
- !ruby/struct:SM::Flow::H 
  level: 4
  text: Parameters
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>id</tt> - This should be the id or an array of ids to be updated.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>attributes</tt> - This should be a Hash of attributes to be set on the object, or an array of Hashes.
  type: :BULLET
- !ruby/struct:SM::Flow::H 
  level: 4
  text: Examples
- !ruby/struct:SM::Flow::VERB 
  body: "  # Updating one record:\n  Person.update(15, { :user_name =&gt; 'Samuel', :group =&gt; 'expert' })\n\n  # Updating multiple records:\n  people = { 1 =&gt; { &quot;first_name&quot; =&gt; &quot;David&quot; }, 2 =&gt; { &quot;first_name&quot; =&gt; &quot;Jeremy&quot; } }\n  Person.update(people.keys, people.values)\n"
full_name: ActiveRecord::Base::update
is_singleton: true
name: update
params: (id, attributes)
visibility: public
