diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-04-07 16:01:12 -0500 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-04-07 16:01:12 -0500 |
commit | 9575c820974b862a19dca1fcff54300b166e9a9c (patch) | |
tree | fe475c7b86ffe24eb00bc4350d1618b910276cc9 /activerecord/lib/active_record/associations | |
parent | e1404ec824d263d25717468c6f4b73ee7b2bdf4c (diff) | |
parent | 2512bd717bbf60364935afdbacb422d9248a1ba8 (diff) | |
download | rails-9575c820974b862a19dca1fcff54300b166e9a9c.tar.gz rails-9575c820974b862a19dca1fcff54300b166e9a9c.tar.bz2 rails-9575c820974b862a19dca1fcff54300b166e9a9c.zip |
Merge pull request #14635 from eileencodes/remove-check-for-present
remove check for present? from delete_all method
Diffstat (limited to 'activerecord/lib/active_record/associations')
-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 |