From 30ba7ee5961bc2c424f28e0319b65f37381d623f Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 20 Nov 2013 14:55:55 -0800 Subject: Expand double-negative in String#blank? regex --- activesupport/lib/active_support/core_ext/object/blank.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/object/blank.rb b/activesupport/lib/active_support/core_ext/object/blank.rb index 8a5eb4bc93..f9ff4d9567 100644 --- a/activesupport/lib/active_support/core_ext/object/blank.rb +++ b/activesupport/lib/active_support/core_ext/object/blank.rb @@ -90,7 +90,7 @@ class String # ' '.blank? # => true # ' something here '.blank? # => false def blank? - self !~ /[^[:space:]]/ + self =~ /\A[[:space:]]*\z/ end end -- cgit v1.2.3