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

Prevent shadowing outer local variable.

This commit is contained in:
Emilio Tagua 2010-09-22 15:03:59 -03:00
parent 7918a5c966
commit eff68d86ad

View file

@ -321,14 +321,14 @@ module ActiveRecord
klasses_and_ids[reflection.klass.name] = id_map unless id_map.empty? klasses_and_ids[reflection.klass.name] = id_map unless id_map.empty?
end end
klasses_and_ids.each do |klass_name, id_map| klasses_and_ids.each do |klass_name, _id_map|
klass = klass_name.constantize klass = klass_name.constantize
table_name = klass.quoted_table_name table_name = klass.quoted_table_name
primary_key = reflection.options[:primary_key] || klass.primary_key primary_key = reflection.options[:primary_key] || klass.primary_key
column_type = klass.columns.detect{|c| c.name == primary_key}.type column_type = klass.columns.detect{|c| c.name == primary_key}.type
ids = id_map.keys.map do |id| ids = _id_map.keys.map do |id|
if column_type == :integer if column_type == :integer
id.to_i id.to_i
elsif column_type == :float elsif column_type == :float
@ -343,7 +343,7 @@ module ActiveRecord
associated_records = klass.unscoped.where([conditions, ids]).apply_finder_options(options.slice(:include, :select, :joins, :order)).to_a associated_records = klass.unscoped.where([conditions, ids]).apply_finder_options(options.slice(:include, :select, :joins, :order)).to_a
set_association_single_records(id_map, reflection.name, associated_records, primary_key) set_association_single_records(_id_map, reflection.name, associated_records, primary_key)
end end
end end