aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-01-30 19:07:08 +0000
committerJon Leighton <j@jonathanleighton.com>2011-02-07 23:35:05 +0000
commitd55406d2e991056b08f69eb68bcf9b17da807b6c (patch)
tree239edd0fef82a334309734b92639740a7e7c73db /activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
parent5f1ea2a26b6e29f235e132d565b53f12e0234c66 (diff)
downloadrails-d55406d2e991056b08f69eb68bcf9b17da807b6c.tar.gz
rails-d55406d2e991056b08f69eb68bcf9b17da807b6c.tar.bz2
rails-d55406d2e991056b08f69eb68bcf9b17da807b6c.zip
Make record.association.destroy(*records) on habtm and hm:t only delete records in the join table. This is to make the destroy method more consistent across the different types of associations. For more details see the CHANGELOG entry.
Diffstat (limited to 'activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb')
-rw-r--r--activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb b/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
index 3329a4af8e..d70f326e55 100644
--- a/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
+++ b/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
@@ -40,7 +40,7 @@ module ActiveRecord
load_target.size
end
- def delete_records(records)
+ def delete_records(records, method = nil)
if sql = @reflection.options[:delete_sql]
records.each { |record| @owner.connection.delete(interpolate_sql(sql, record)) }
else