diff options
author | Mislav Marohnić <mislav.marohnic@gmail.com> | 2010-07-08 13:58:23 +0200 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-07-08 11:35:17 -0700 |
commit | 00f1cd71a97bfa79e6b62a870b09ca914c48e421 (patch) | |
tree | 9345dfb3da419b80e32ce8c0d22c90dd70a49983 /activerecord/lib/active_record/associations/association_collection.rb | |
parent | 951dbf06b4177b1c3d912213166ca0b14374a48b (diff) | |
download | rails-00f1cd71a97bfa79e6b62a870b09ca914c48e421.tar.gz rails-00f1cd71a97bfa79e6b62a870b09ca914c48e421.tar.bz2 rails-00f1cd71a97bfa79e6b62a870b09ca914c48e421.zip |
fix ActiveRecord `destroy_all` so it returns destroyed records
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activerecord/lib/active_record/associations/association_collection.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/association_collection.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/association_collection.rb b/activerecord/lib/active_record/associations/association_collection.rb index a4e08c7d41..615b7d2719 100644 --- a/activerecord/lib/active_record/associations/association_collection.rb +++ b/activerecord/lib/active_record/associations/association_collection.rb @@ -253,9 +253,10 @@ module ActiveRecord # See destroy for more info. def destroy_all load_target - destroy(@target) - reset_target! - reset_named_scopes_cache! + destroy(@target).tap do + reset_target! + reset_named_scopes_cache! + end end def create(attrs = {}) |