diff options
author | René van den Berg <rene.vandenberg@ogd.nl> | 2014-11-24 16:03:07 +0100 |
---|---|---|
committer | René van den Berg <rene.vandenberg@ogd.nl> | 2014-11-24 16:03:07 +0100 |
commit | 91c0c277698ab6ca4132a580f4212aa913492a8c (patch) | |
tree | 5f2567047e3fbfe2a8ff3e5c037df4c1f0aa3d04 /activerecord | |
parent | 9ce105734d0b28de324c79a9e89906219f1555b7 (diff) | |
download | rails-91c0c277698ab6ca4132a580f4212aa913492a8c.tar.gz rails-91c0c277698ab6ca4132a580f4212aa913492a8c.tar.bz2 rails-91c0c277698ab6ca4132a580f4212aa913492a8c.zip |
Reword documentation for update_all
It now contains a carefully formulated reference to the "current relation" which might help clarify that the receiving will generate its own scope, escaping the need for explicitly referencing `default_scope` which is, after all, just another way of specifying a scope and nothing special.
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/relation.rb | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index fc3306ee81..561ed222d1 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -304,8 +304,7 @@ module ActiveRecord klass.current_scope = previous end - # Updates all records in the current scope (respecting the <tt>default_scope</tt>, <tt>where</tt>, - # <tt>limit</tt> and <tt>order</tt> specified) with details given. This method constructs a single SQL update_all + # Updates all records in the current relation with details given. This method constructs a single SQL UPDATE # statement and sends it straight to the database. It does not instantiate the involved models and it does not # trigger Active Record callbacks or validations. Values passed to `update_all` will not go through # ActiveRecord's type-casting behavior. It should receive only values that can be passed as-is to the SQL @@ -320,12 +319,6 @@ module ActiveRecord # # Update all customers with the given attributes # Customer.update_all wants_email: true # - # # Update all active accounts with the given attributes - # class Account < ActiveRecord::Base - # default_scope -> { where active: true } - # end - # Account.update_all(failed_logins: 0) - # # # Update all books with 'Rails' in their title # Book.where('title LIKE ?', '%Rails%').update_all(author: 'David') # |