Permalink
Browse files

Merge pull request #14635 from eileencodes/remove-check-for-present

remove check for present? from delete_all method
  • Loading branch information...
2 parents e1404ec + 2512bd7 commit 9575c820974b862a19dca1fcff54300b166e9a9c @rafaelfranca rafaelfranca committed Apr 7, 2014
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/lib/active_record/associations/collection_association.rb
@@ -182,11 +182,11 @@ def transaction(*args)
#
# 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

0 comments on commit 9575c82

Please sign in to comment.