From 7b2db96c78aecc78c7987b7cc10cd0ce3171a5d5 Mon Sep 17 00:00:00 2001 From: Prem Sichanugrist Date: Sun, 27 Dec 2009 23:31:23 +0700 Subject: [PATCH] Patch object#present? to return object itself if it's not blank --- .../lib/active_support/core_ext/object/blank.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/activesupport/lib/active_support/core_ext/object/blank.rb b/activesupport/lib/active_support/core_ext/object/blank.rb index 9a1f663..3bfb8ad 100644 --- a/activesupport/lib/active_support/core_ext/object/blank.rb +++ b/activesupport/lib/active_support/core_ext/object/blank.rb @@ -15,7 +15,7 @@ class Object # An object is present if it's not blank. def present? - !blank? + blank? ? false : self end end -- 1.6.4.2