diff options
author | Jon Leighton <j@jonathanleighton.com> | 2012-05-18 21:11:34 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2012-05-18 21:11:34 +0100 |
commit | dcc576df8f4e6dfb2ef9891454b771c7d47ea219 (patch) | |
tree | f2ae25cba421e373bb8815993036f6cbe45b05b7 /activerecord/lib/active_record | |
parent | a1dd00810cccc40c66ffdf463c50c26452023353 (diff) | |
download | rails-dcc576df8f4e6dfb2ef9891454b771c7d47ea219.tar.gz rails-dcc576df8f4e6dfb2ef9891454b771c7d47ea219.tar.bz2 rails-dcc576df8f4e6dfb2ef9891454b771c7d47ea219.zip |
fix #delete_all with habtm with :delete_sql
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb | 1 |
1 files changed, 1 insertions, 0 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 14ef4f4b31..58d041ec1d 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,6 +40,7 @@ module ActiveRecord def delete_records(records, method) if sql = options[:delete_sql] + records = load_target if records == :all records.each { |record| owner.connection.delete(interpolate(sql, record)) } else relation = join_table |