From ef2738472d5c9e6e561d97c9fadbad6b3863017f Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Fri, 6 May 2011 17:30:00 +0200 Subject: Revert "Small edit to the if statement simplification for blank? on the 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 a4b6e3d9be338e93320606f7cb14759b26ced8df. --- activesupport/lib/active_support/core_ext/object/blank.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/core_ext/object/blank.rb b/activesupport/lib/active_support/core_ext/object/blank.rb index d756b8cca0..20085c4fb3 100644 --- a/activesupport/lib/active_support/core_ext/object/blank.rb +++ b/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: # -- cgit v1.2.3