Skip to content

Commit

Permalink
Merge pull request rails#6395 from kennyj/fix_warning_20120519-2
Browse files Browse the repository at this point in the history
Fix warning: shadowing outer local variable - constant.
  • Loading branch information
rafaelfranca committed May 19, 2012
2 parents 329a5a4 + 3f1caaf commit 26bdcf7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions activesupport/lib/active_support/inflector/methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 26bdcf7

Please sign in to comment.