From 2512bd717bbf60364935afdbacb422d9248a1ba8 Mon Sep 17 00:00:00 2001 From: eileencodes Date: Mon, 7 Apr 2014 14:16:55 -0400 Subject: remove check for present? from delete_all Passing in a blank string is a bug so there's no reason to check for a blank string. --- activerecord/lib/active_record/associations/collection_association.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb index dee7e972c1..803e3ab9ab 100644 --- a/activerecord/lib/active_record/associations/collection_association.rb +++ b/activerecord/lib/active_record/associations/collection_association.rb @@ -182,11 +182,11 @@ module ActiveRecord # # See delete for more info. def delete_all(dependent = nil) - if dependent.present? && ![:nullify, :delete_all].include?(dependent) + if dependent && ![:nullify, :delete_all].include?(dependent) raise ArgumentError, "Valid values are :nullify or :delete_all" end - dependent = if dependent.present? + dependent = if dependent dependent elsif options[:dependent] == :destroy :delete_all -- cgit v1.2.3