aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorPrathamesh Sonpatki <csonpatki@gmail.com>2015-03-06 17:07:27 +0530
committerPrathamesh Sonpatki <csonpatki@gmail.com>2015-03-06 21:53:07 +0530
commit88199f7f03c6a5b1467b85edf10b59c6e92b59ab (patch)
tree63cf6f272f7ab0bc09077d208e2ddd3d5879e5f7 /activerecord
parenteac3349285718e2a145c1e85e1fdb7bf96fc5bd1 (diff)
downloadrails-88199f7f03c6a5b1467b85edf10b59c6e92b59ab.tar.gz
rails-88199f7f03c6a5b1467b85edf10b59c6e92b59ab.tar.bz2
rails-88199f7f03c6a5b1467b85edf10b59c6e92b59ab.zip
Updated documentation of CollectionProxy#clear [ci skip]
- CollectionProxy#clear method calls delete_all so the SQL is directly run into the database. - So the updated_at column of the object on which its run is not updated. - Closes #17161
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/associations/collection_proxy.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/associations/collection_proxy.rb b/activerecord/lib/active_record/associations/collection_proxy.rb
index e11c9490b7..685c3a5f17 100644
--- a/activerecord/lib/active_record/associations/collection_proxy.rb
+++ b/activerecord/lib/active_record/associations/collection_proxy.rb
@@ -976,6 +976,9 @@ module ActiveRecord
# Equivalent to +delete_all+. The difference is that returns +self+, instead
# of an array with the deleted objects, so methods can be chained. See
# +delete_all+ for more information.
+ # Note that because +delete_all+ removes records by directly
+ # running an SQL query into the database, the +updated_at+ column of
+ # the object is not changed.
def clear
delete_all
self