diff options
author | Prathamesh Sonpatki <csonpatki@gmail.com> | 2015-03-06 17:07:27 +0530 |
---|---|---|
committer | Prathamesh Sonpatki <csonpatki@gmail.com> | 2015-03-06 21:53:07 +0530 |
commit | 88199f7f03c6a5b1467b85edf10b59c6e92b59ab (patch) | |
tree | 63cf6f272f7ab0bc09077d208e2ddd3d5879e5f7 /activerecord | |
parent | eac3349285718e2a145c1e85e1fdb7bf96fc5bd1 (diff) | |
download | rails-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.rb | 3 |
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 |