diff options
author | eileencodes <eileencodes@gmail.com> | 2014-04-07 14:16:55 -0400 |
---|---|---|
committer | eileencodes <eileencodes@gmail.com> | 2014-04-07 16:11:42 -0400 |
commit | 2512bd717bbf60364935afdbacb422d9248a1ba8 (patch) | |
tree | 9d75761e5ade913b702e8f7078029d1a021e01a9 /activerecord/lib | |
parent | 70c83f49f8fcefdf52c2ed22706a14e29559cea5 (diff) | |
download | rails-2512bd717bbf60364935afdbacb422d9248a1ba8.tar.gz rails-2512bd717bbf60364935afdbacb422d9248a1ba8.tar.bz2 rails-2512bd717bbf60364935afdbacb422d9248a1ba8.zip |
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.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/collection_association.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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 |