diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-05-19 07:57:30 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-05-19 07:57:30 -0700 |
commit | 26bdcf7299a44b45242e2e4be209b325cfe6bfb4 (patch) | |
tree | 35214b468dce58dbe2df4df377401e63019fa190 | |
parent | 329a5a43227be48b408b702438b355c087fd2866 (diff) | |
parent | 3f1caaf23a60df82a72873b4bfce4dc47aa51029 (diff) | |
download | rails-26bdcf7299a44b45242e2e4be209b325cfe6bfb4.tar.gz rails-26bdcf7299a44b45242e2e4be209b325cfe6bfb4.tar.bz2 rails-26bdcf7299a44b45242e2e4be209b325cfe6bfb4.zip |
Merge pull request #6395 from kennyj/fix_warning_20120519-2
Fix warning: shadowing outer local variable - constant.
-rw-r--r-- | activesupport/lib/active_support/inflector/methods.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/inflector/methods.rb b/activesupport/lib/active_support/inflector/methods.rb index e5b0cf4f9e..2acc6ddee5 100644 --- a/activesupport/lib/active_support/inflector/methods.rb +++ b/activesupport/lib/active_support/inflector/methods.rb @@ -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 |