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:
parent
eac3349285
commit
88199f7f03
1 changed files with 3 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue