diff options
Diffstat (limited to 'activesupport/lib/active_support/core_ext/object_and_class.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/object_and_class.rb | 10 |
1 files changed, 4 insertions, 6 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 cff8fca5bb..1e080d35a4 100644 --- a/activesupport/lib/active_support/core_ext/object_and_class.rb +++ b/activesupport/lib/active_support/core_ext/object_and_class.rb @@ -14,19 +14,17 @@ class Object #:nodoc: subclasses end - # "", " ", nil, and 0 are all blank + # "", " ", nil, [], and {} are blank def blank? if respond_to?(:empty?) && respond_to?(:strip) - strip.empty? - elsif respond_to? :empty? + empty? or strip.empty? + elsif respond_to?(:empty?) empty? - elsif respond_to? :zero? - zero? else !self end end - + def suppress(*exception_classes) begin yield rescue Exception => e |