aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-02-11 23:58:15 +0100
committerXavier Noria <fxn@hashref.com>2010-02-11 23:58:15 +0100
commita506bac58616db2dc2b470a2416deed398645916 (patch)
tree0c6359d89894dd6f42e35a0583141bc28c089417 /activesupport/lib/active_support
parentaa82bdf92953824fd35db4a734bf6effa8de3329 (diff)
downloadrails-a506bac58616db2dc2b470a2416deed398645916.tar.gz
rails-a506bac58616db2dc2b470a2416deed398645916.tar.bz2
rails-a506bac58616db2dc2b470a2416deed398645916.zip
fixes Module#anonymous? for 1.9
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/core_ext/module/anonymous.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/anonymous.rb b/activesupport/lib/active_support/core_ext/module/anonymous.rb
index 60d7d9410b..df25a09ec9 100644
--- a/activesupport/lib/active_support/core_ext/module/anonymous.rb
+++ b/activesupport/lib/active_support/core_ext/module/anonymous.rb
@@ -1,4 +1,6 @@
-class Module
+require 'active_support/core_ext/object/blank'
+
+class Module
# A module may or may not have a name.
#
# module M; end
@@ -15,6 +17,8 @@ class Module
# m.name # => "M"
#
def anonymous?
- name == ''
+ # Uses blank? because the name of an anonymous class is an empty
+ # string in 1.8, and nil in 1.9.
+ name.blank?
end
end