diff options
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/core_ext/blank.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/blank.rb b/activesupport/lib/active_support/core_ext/blank.rb index dfe33162e8..4f8dc4e281 100644 --- a/activesupport/lib/active_support/core_ext/blank.rb +++ b/activesupport/lib/active_support/core_ext/blank.rb @@ -12,6 +12,11 @@ class Object def blank? respond_to?(:empty?) ? empty? : !self end + + # An object is present if it's not blank. + def present? + !blank? + end end class NilClass #:nodoc: |