diff options
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/object_and_class.rb | 10 |
1 files changed, 10 insertions, 0 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 59a463ae29..eb54f79534 100644 --- a/activesupport/lib/active_support/core_ext/object_and_class.rb +++ b/activesupport/lib/active_support/core_ext/object_and_class.rb @@ -11,6 +11,16 @@ class Object #:nodoc: end subclasses end + + def blank? + if respond_to? :empty? + empty? + elsif respond_to? :zero? + zero? + else + !self + end + end end class Class #:nodoc: |