aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2016-11-01 14:19:08 -0400
committerGitHub <noreply@github.com>2016-11-01 14:19:08 -0400
commit8632efd8db78060f78be9f76be8b6149de05734e (patch)
tree4228138b44a60fa4376cae19bbc9f1bd4c2ec398 /activerecord/lib/active_record
parentc7adc610f0233b9afd51a6d68aa9061cdb250fad (diff)
parent5f9051c3412c634898fc304297f8871a63ad4f0f (diff)
downloadrails-8632efd8db78060f78be9f76be8b6149de05734e.tar.gz
rails-8632efd8db78060f78be9f76be8b6149de05734e.tar.bz2
rails-8632efd8db78060f78be9f76be8b6149de05734e.zip
Merge pull request #26453 from kamipo/remove_unused_internal_dependent_option
Remove unused internal `:dependent` option in `CollectionAssociation#delete`
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/associations/collection_association.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb
index 1116e903f0..9230225c9d 100644
--- a/activerecord/lib/active_record/associations/collection_association.rb
+++ b/activerecord/lib/active_record/associations/collection_association.rb
@@ -192,11 +192,8 @@ module ActiveRecord
# +delete_records+. They are in any case removed from the collection.
def delete(*records)
return if records.empty?
- _options = records.extract_options!
- dependent = _options[:dependent] || options[:dependent]
-
records = find(records) if records.any? { |record| record.kind_of?(Integer) || record.kind_of?(String) }
- delete_or_destroy(records, dependent)
+ delete_or_destroy(records, options[:dependent])
end
# Deletes the +records+ and removes them from this association calling