From f28bd9557c669cd63c31704202a46dd83f0a4102 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Wed, 22 Apr 2009 17:41:28 -0700 Subject: Fix dependencies revealed by testing in isolation --- activesupport/lib/active_support/core_ext/module/introspection.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'activesupport/lib/active_support/core_ext/module/introspection.rb') diff --git a/activesupport/lib/active_support/core_ext/module/introspection.rb b/activesupport/lib/active_support/core_ext/module/introspection.rb index 7708d573fa..23a1063901 100644 --- a/activesupport/lib/active_support/core_ext/module/introspection.rb +++ b/activesupport/lib/active_support/core_ext/module/introspection.rb @@ -1,3 +1,5 @@ +require 'active_support/inflector' + class Module # Returns the name of the module containing this one. # @@ -26,7 +28,7 @@ class Module # p Module.new.parent # => Object # def parent - parent_name ? parent_name.constantize : Object + parent_name ? ActiveSupport::Inflector.constantize(parent_name) : Object end # Returns all the parents of this module according to its name, ordered from @@ -47,7 +49,7 @@ class Module if parent_name parts = parent_name.split('::') until parts.empty? - parents << (parts * '::').constantize + parents << ActiveSupport::Inflector.constantize(parts * '::') parts.pop end end -- cgit v1.2.3