aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/has_many_association.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-02-06 22:14:16 +0000
committerJon Leighton <j@jonathanleighton.com>2011-02-07 23:35:05 +0000
commite62b57647258fad34129975c5a264d19af2dbbe8 (patch)
treeffe90d076be6be8de213faac029c9e042c2a1749 /activerecord/lib/active_record/associations/has_many_association.rb
parentd9870d92f733f0ef4452a0b6df338ed9dbcc05b3 (diff)
downloadrails-e62b57647258fad34129975c5a264d19af2dbbe8.tar.gz
rails-e62b57647258fad34129975c5a264d19af2dbbe8.tar.bz2
rails-e62b57647258fad34129975c5a264d19af2dbbe8.zip
Refactor the implementations of AssociatioCollection#delete and #destroy to be more consistent with each other, and to stop passing blocks around, thus making the execution easier to follow.
Diffstat (limited to 'activerecord/lib/active_record/associations/has_many_association.rb')
-rw-r--r--activerecord/lib/active_record/associations/has_many_association.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/has_many_association.rb b/activerecord/lib/active_record/associations/has_many_association.rb
index 732f63713e..0b246587c0 100644
--- a/activerecord/lib/active_record/associations/has_many_association.rb
+++ b/activerecord/lib/active_record/associations/has_many_association.rb
@@ -80,7 +80,7 @@ module ActiveRecord
end
# Deletes the records according to the <tt>:dependent</tt> option.
- def delete_records(records, method = @reflection.options[:dependent])
+ def delete_records(records, method)
if method == :destroy
records.each { |r| r.destroy }
update_counter(-records.length) unless inverse_updates_counter_cache?