Skip to content

Commit

Permalink
Revert "Small edit to the if statement simplification for blank? on t…
Browse files Browse the repository at this point in the history
…he Object class. An Object doesn't need to be nil and empty to be blank? just one or the other."

Reason: the original code is correct, see

    !nil && !empty -> !(nil || empty) -> !blank

That said, this example has too many negations
for my linking. Think should be revised to be
more positive and straightforward to read.

This reverts commit a4b6e3d.
  • Loading branch information
fxn committed May 6, 2011
1 parent a4b6e3d commit ef27384
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activesupport/lib/active_support/core_ext/object/blank.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Object
#
# This simplifies:
#
# if !address.nil? || !address.empty?
# if !address.nil? && !address.empty?
#
# ...to:
#
Expand Down

0 comments on commit ef27384

Please sign in to comment.