aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/inflector/methods.rb
diff options
context:
space:
mode:
authorMarc-Andre Lafortune <github@marc-andre.ca>2012-05-05 10:13:33 -0400
committerAndrew White <andyw@pixeltrix.co.uk>2012-05-19 15:47:35 +0100
commiteb09411460d11c7b1b1b54272ba345a1e1cf472d (patch)
treeaead0864ec29f63235c90e203c7db484f0d2d6b6 /activesupport/lib/active_support/inflector/methods.rb
parent99e9a733c8852f4ff065f2ede9c9cd03475411a2 (diff)
downloadrails-eb09411460d11c7b1b1b54272ba345a1e1cf472d.tar.gz
rails-eb09411460d11c7b1b1b54272ba345a1e1cf472d.tar.bz2
rails-eb09411460d11c7b1b1b54272ba345a1e1cf472d.zip
Fix constantize so top level constants are looked up properly.
Diffstat (limited to 'activesupport/lib/active_support/inflector/methods.rb')
-rw-r--r--activesupport/lib/active_support/inflector/methods.rb2
1 files changed, 1 insertions, 1 deletions
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