You probably can't find good documentation on ActiveRecord::Base#update , because the method was deprecated with Rails version 2.3.8, according to the APIdock. .
The reason you can still use it is because it has been ported to ActiveRecord::Relation , which is visible in rails/activerecord/lib/active_record/relation.rb .
rails/activerecord/lib/active_record.rb contains all the autoload for ActiveRecord , which includes :Relation .
The documentation for ActiveRecord::Relation#update as follows:
Updates the object (or several objects) and stores it in the database if the checks pass. The resulting object is returned whether the object was successfully stored in the database or not.
==== Parameters
- + id + - This should be an identifier or an array of identifiers that need to be updated.
- + attributes + - This should be an attribute hash or an array of hashes.
==== Examples
# Updates one record Person.update(15, :user_name => 'Samuel', :group => 'expert') # Updates multiple records people = { 1 => { "first_name" => "David" }, 2 => { "first_name" => "Jeremy" } } Person.update(people.keys, people.values)
EDIT. To answer your initial question, in most cases a search on api.rubyonrails.org is enough to find the information you are looking for since if the information is updated.
For more information on the API, use apidock.com/rails . Doing a search there for the βupdateβ actually shows both versions ( ::Base and ::Relation ) and gives you detailed information about each and which version of Rails each is used for.
source share