Skip to content
Browse files

Revert "Small edit to the if statement simplification for blank? on t…

…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...
1 parent a4b6e3d commit ef2738472d5c9e6e561d97c9fadbad6b3863017f @fxn fxn committed May 6, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 activesupport/lib/active_support/core_ext/object/blank.rb
View
2 activesupport/lib/active_support/core_ext/object/blank.rb
@@ -4,7 +4,7 @@ class Object
#
# This simplifies:
#
- # if !address.nil? || !address.empty?
+ # if !address.nil? && !address.empty?
#
# ...to:
#

0 comments on commit ef27384

Please sign in to comment.
Something went wrong with that request. Please try again.