aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/blank.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/core_ext/blank.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/blank.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/activesupport/lib/active_support/core_ext/blank.rb b/activesupport/lib/active_support/core_ext/blank.rb
index d2a940f5b9..c4695816e2 100644
--- a/activesupport/lib/active_support/core_ext/blank.rb
+++ b/activesupport/lib/active_support/core_ext/blank.rb
@@ -7,13 +7,7 @@ class Object
# to
# if !address.blank?
def blank?
- if respond_to?(:empty?) && respond_to?(:strip)
- empty? or strip.empty?
- elsif respond_to?(:empty?)
- empty?
- else
- !self
- end
+ respond_to?(:empty?) ? empty? : !self
end
end
@@ -45,7 +39,7 @@ end
class String #:nodoc:
def blank?
- empty? || strip.empty?
+ self !~ /\S/
end
end