Browse files

Avoid calling triggering const_missing if const_missing is private wh…

…en doing constantize
  • Loading branch information...
1 parent 98c299f commit ae8c384e2c07da4870dd3919321a6d49aeff3588 Carl Lerche committed Feb 19, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 activesupport/lib/active_support/inflector/methods.rb
View
2 activesupport/lib/active_support/inflector/methods.rb
@@ -109,7 +109,7 @@ def constantize(camel_cased_word) #:nodoc:
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

0 comments on commit ae8c384

Please sign in to comment.