aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorVipul A M <vipulnsward@gmail.com>2013-03-19 01:15:25 +0530
committerVipul A M <vipulnsward@gmail.com>2013-03-19 01:15:25 +0530
commitaee54249dd68c606233fd10c60e62934ab548bdc (patch)
tree7a5d81120e918bd799fe8e2c781f987245de4e9c /activerecord/lib
parent4e7292c0262ae70d968e0732bb6fea627646feef (diff)
downloadrails-aee54249dd68c606233fd10c60e62934ab548bdc.tar.gz
rails-aee54249dd68c606233fd10c60e62934ab548bdc.tar.bz2
rails-aee54249dd68c606233fd10c60e62934ab548bdc.zip
1. Change from each to each_value since we did not use key
2. drop assignment of value to sum in test
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/associations/preloader/has_and_belongs_to_many.rb2
1 files changed, 1 insertions, 1 deletions
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