Permalink
Browse files

fixes Module#anonymous? for 1.9

  • Loading branch information...
1 parent aa82bdf commit a506bac58616db2dc2b470a2416deed398645916 @fxn fxn committed Feb 11, 2010
Showing with 6 additions and 2 deletions.
  1. +6 −2 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

0 comments on commit a506bac

Please sign in to comment.