From 88199f7f03c6a5b1467b85edf10b59c6e92b59ab Mon Sep 17 00:00:00 2001 From: Prathamesh Sonpatki Date: Fri, 6 Mar 2015 17:07:27 +0530 Subject: [PATCH] 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 --- .../lib/active_record/associations/collection_proxy.rb | 3 +++ 1 file changed, 3 insertions(+) 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