aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/module/introspection.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-04-22 17:41:28 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2009-04-22 18:54:13 -0700
commitf28bd9557c669cd63c31704202a46dd83f0a4102 (patch)
tree4ec4423cfbcc9414982e0e72adda354c69cce541 /activesupport/lib/active_support/core_ext/module/introspection.rb
parent5c4ba6e3fc66a779c28a70b8d7bde14b49e7c36c (diff)
downloadrails-f28bd9557c669cd63c31704202a46dd83f0a4102.tar.gz
rails-f28bd9557c669cd63c31704202a46dd83f0a4102.tar.bz2
rails-f28bd9557c669cd63c31704202a46dd83f0a4102.zip
Fix dependencies revealed by testing in isolation
Diffstat (limited to 'activesupport/lib/active_support/core_ext/module/introspection.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/module/introspection.rb6
1 files changed, 4 insertions, 2 deletions
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