From ae8c384e2c07da4870dd3919321a6d49aeff3588 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Thu, 18 Feb 2010 16:29:32 -0800 Subject: Avoid calling triggering const_missing if const_missing is private when doing constantize --- activesupport/lib/active_support/inflector/methods.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/inflector') diff --git a/activesupport/lib/active_support/inflector/methods.rb b/activesupport/lib/active_support/inflector/methods.rb index 41277893e3..c7df62e915 100644 --- a/activesupport/lib/active_support/inflector/methods.rb +++ b/activesupport/lib/active_support/inflector/methods.rb @@ -109,7 +109,7 @@ module ActiveSupport constant = Object names.each do |name| - constant = constant.const_get(name, false) || constant.const_missing(name) + constant = constant.const_defined?(name, false) ? constant.const_get(name) : constant.const_missing(name) end constant end -- cgit v1.2.3