1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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
This commit is contained in:
Prathamesh Sonpatki 2015-03-06 17:07:27 +05:30
parent eac3349285
commit 88199f7f03

View file

@ -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