From aee54249dd68c606233fd10c60e62934ab548bdc Mon Sep 17 00:00:00 2001 From: Vipul A M Date: Tue, 19 Mar 2013 01:15:25 +0530 Subject: 1. Change from each to each_value since we did not use key 2. drop assignment of value to sum in test --- .../lib/active_record/associations/preloader/has_and_belongs_to_many.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/associations/preloader/has_and_belongs_to_many.rb b/activerecord/lib/active_record/associations/preloader/has_and_belongs_to_many.rb index 8e8925f0a9..9a3fada380 100644 --- a/activerecord/lib/active_record/associations/preloader/has_and_belongs_to_many.rb +++ b/activerecord/lib/active_record/associations/preloader/has_and_belongs_to_many.rb @@ -35,7 +35,7 @@ module ActiveRecord # record def associated_records_by_owner records = {} - super.each do |owner_key, rows| + super.each_value do |rows| rows.map! { |row| records[row[klass.primary_key]] ||= klass.instantiate(row) } end end -- cgit v1.2.3