From 5f9051c3412c634898fc304297f8871a63ad4f0f Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Sun, 11 Sep 2016 06:38:46 +0900 Subject: Remove unused internal `:dependent` option in `CollectionAssociation#delete` The internal `:dependent` option was introduced at #10604. But currently unused. --- .../lib/active_record/associations/collection_association.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb index 278c95e27b..358f0d4497 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 -- cgit v1.2.3