From eb09411460d11c7b1b1b54272ba345a1e1cf472d Mon Sep 17 00:00:00 2001 From: Marc-Andre Lafortune Date: Sat, 5 May 2012 10:13:33 -0400 Subject: Fix constantize so top level constants are looked up properly. --- activesupport/lib/active_support/inflector/methods.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/inflector/methods.rb') diff --git a/activesupport/lib/active_support/inflector/methods.rb b/activesupport/lib/active_support/inflector/methods.rb index 274dc90eff..11f3c4c46f 100644 --- a/activesupport/lib/active_support/inflector/methods.rb +++ b/activesupport/lib/active_support/inflector/methods.rb @@ -204,7 +204,7 @@ module ActiveSupport names.inject(Object) do |constant, name| candidate = constant.const_get(name) - if constant.const_defined?(name, false) || !Object.const_defined?(name) + if constant.const_defined?(name, false) || constant == Object || !Object.const_defined?(name) candidate else # Go down the ancestors to check it it's owned -- cgit v1.2.3