Skip to content

Commit

Permalink
Fix warning: shadowing outer local variable - constant.
Browse files Browse the repository at this point in the history
  • Loading branch information
kennyj committed May 19, 2012
1 parent 329a5a4 commit 3f1caaf
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 3f1caaf

Please sign in to comment.