diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-03-31 19:09:32 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-03-31 19:09:32 -0700 |
commit | e9f53f7a7a5c57838654aad9ee1d8b0086b685d7 (patch) | |
tree | 5e30ea8ac35821a8fd0fc087b17742bc820dbc95 /activerecord/lib | |
parent | 165d93b22ff5f8798296bd5d7642d0ddb8996c74 (diff) | |
parent | e247f3257927e008ed89944249ac38a8838f719f (diff) | |
download | rails-e9f53f7a7a5c57838654aad9ee1d8b0086b685d7.tar.gz rails-e9f53f7a7a5c57838654aad9ee1d8b0086b685d7.tar.bz2 rails-e9f53f7a7a5c57838654aad9ee1d8b0086b685d7.zip |
Merge pull request #14546 from eileencodes/fix_delete_all_to_not_use_IN_statement
Fix delete all to not produce sql in statement
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/collection_association.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb index 1f314e0677..80ae38b3fb 100644 --- a/activerecord/lib/active_record/associations/collection_association.rb +++ b/activerecord/lib/active_record/associations/collection_association.rb @@ -248,7 +248,7 @@ module ActiveRecord dependent = _options[:dependent] || options[:dependent] if records.first == :all - if loaded? || dependent == :destroy + if (loaded? || dependent == :destroy) && dependent != :delete_all delete_or_destroy(load_target, dependent) else delete_records(:all, dependent) |