diff options
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/core_ext/object_and_class.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/object_and_class.rb b/activesupport/lib/active_support/core_ext/object_and_class.rb index be486b0816..b8e9d27217 100644 --- a/activesupport/lib/active_support/core_ext/object_and_class.rb +++ b/activesupport/lib/active_support/core_ext/object_and_class.rb @@ -12,8 +12,11 @@ class Object #:nodoc: subclasses end + # "", " ", nil, and 0 are all blank def blank? - if respond_to? :empty? + if respond_to?(:empty?) && respond_to?(:strip) + strip.empty? + elsif respond_to? :empty? empty? elsif respond_to? :zero? zero? |