aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/CHANGELOG2
-rw-r--r--activesupport/lib/active_support/core_ext/object_and_class.rb5
2 files changed, 6 insertions, 1 deletions
diff --git a/activesupport/CHANGELOG b/activesupport/CHANGELOG
index ac3e9eb7e5..2c70cecc2b 100644
--- a/activesupport/CHANGELOG
+++ b/activesupport/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Added that " " is now also blank? (using strip if available)
+
* Fixed Dependencies so all modules are able to load missing constants #1173 [Nicholas Seckar]
* Fixed the Inflector to underscore strings containing numbers, so Area51Controller becomes area51_controller #1176 [Nicholas Seckar]
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 be486b0816..b8e9d27217 100644
--- a/activesupport/lib/active_support/core_ext/object_and_class.rb
+++ b/activesupport/lib/active_support/core_ext/object_and_class.rb
@@ -12,8 +12,11 @@ class Object #:nodoc:
subclasses
end
+ # "", " ", nil, and 0 are all blank
def blank?
- if respond_to? :empty?
+ if respond_to?(:empty?) && respond_to?(:strip)
+ strip.empty?
+ elsif respond_to? :empty?
empty?
elsif respond_to? :zero?
zero?