1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #6395 from kennyj/fix_warning_20120519-2

Fix warning: shadowing outer local variable - constant.
This commit is contained in:
Rafael Mendonça França 2012-05-19 07:57:30 -07:00
commit 26bdcf7299

View file

@ -212,10 +212,10 @@ module ActiveSupport
# 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