Permalink
Browse files

Merge pull request #6395 from kennyj/fix_warning_20120519-2

Fix warning: shadowing outer local variable - constant.
  • Loading branch information...
2 parents 329a5a4 + 3f1caaf commit 26bdcf7299a44b45242e2e4be209b325cfe6bfb4 @rafaelfranca rafaelfranca committed May 19, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 activesupport/lib/active_support/inflector/methods.rb
@@ -212,10 +212,10 @@ def constantize(camel_cased_word)
# Go down the ancestors to check it it's owned
# directly before we reach Object or the end of ancestors.
- constant = constant.ancestors.inject do |constant, ancestor|
- break constant if ancestor == Object
+ constant = constant.ancestors.inject do |const, ancestor|
+ break const if ancestor == Object
break ancestor if ancestor.const_defined?(name, false)
- constant
+ const
end
# owner is in Object, so raise

0 comments on commit 26bdcf7

Please sign in to comment.