aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/association_preload.rb
diff options
context:
space:
mode:
authorŁukasz Strzałkowski <lukasz.strzalkowski@gmail.com>2010-07-15 03:43:59 +0800
committerAaron Patterson <aaron.patterson@gmail.com>2010-07-19 23:44:45 +0800
commit247886e1b4256aeebc6b5fde0549400240b04e35 (patch)
tree18db2e00db04f30ddc76120c603fce41b7f737ab /activerecord/lib/active_record/association_preload.rb
parentb22c11fa533fd523e8cadd36e75dd76b6a9f0488 (diff)
downloadrails-247886e1b4256aeebc6b5fde0549400240b04e35.tar.gz
rails-247886e1b4256aeebc6b5fde0549400240b04e35.tar.bz2
rails-247886e1b4256aeebc6b5fde0549400240b04e35.zip
Removed warnings when a variable is shadowed
Diffstat (limited to 'activerecord/lib/active_record/association_preload.rb')
-rw-r--r--activerecord/lib/active_record/association_preload.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/association_preload.rb b/activerecord/lib/active_record/association_preload.rb
index cbec5789fd..9172ab2a20 100644
--- a/activerecord/lib/active_record/association_preload.rb
+++ b/activerecord/lib/active_record/association_preload.rb
@@ -112,13 +112,13 @@ module ActiveRecord
# Not all records have the same class, so group then preload
# group on the reflection itself so that if various subclass share the same association then we do not split them
# unnecessarily
- records.group_by {|record| class_to_reflection[record.class] ||= record.class.reflections[association]}.each do |reflection, records|
+ records.group_by { |record| class_to_reflection[record.class] ||= record.class.reflections[association]}.each do |reflection, _records|
raise ConfigurationError, "Association named '#{ association }' was not found; perhaps you misspelled it?" unless reflection
# 'reflection.macro' can return 'belongs_to', 'has_many', etc. Thus,
# the following could call 'preload_belongs_to_association',
# 'preload_has_many_association', etc.
- send("preload_#{reflection.macro}_association", records, reflection, preload_options)
+ send("preload_#{reflection.macro}_association", _records, reflection, preload_options)
end
end