diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2013-03-30 15:47:38 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2013-03-30 15:47:38 +0530 |
commit | e63086c135bf17a43e0807ecdef3e54b22048152 (patch) | |
tree | 89f51923c9ea02d49f4ea97e8ec3dc0f5e3c5119 /activerecord/lib/active_record/associations/preloader | |
parent | 06e22c01e86e47ebe0835e4c6ec351175cf91b96 (diff) | |
parent | 6d8c070821bc846eb263b8c045ae652ebd751569 (diff) | |
download | rails-e63086c135bf17a43e0807ecdef3e54b22048152.tar.gz rails-e63086c135bf17a43e0807ecdef3e54b22048152.tar.bz2 rails-e63086c135bf17a43e0807ecdef3e54b22048152.zip |
Merge branch 'master' of github.com:rails/rails
Diffstat (limited to 'activerecord/lib/active_record/associations/preloader')
-rw-r--r-- | activerecord/lib/active_record/associations/preloader/has_and_belongs_to_many.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/associations/preloader/has_many_through.rb | 2 |
2 files changed, 2 insertions, 2 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 diff --git a/activerecord/lib/active_record/associations/preloader/has_many_through.rb b/activerecord/lib/active_record/associations/preloader/has_many_through.rb index 9a662d3f53..38bc7ce7da 100644 --- a/activerecord/lib/active_record/associations/preloader/has_many_through.rb +++ b/activerecord/lib/active_record/associations/preloader/has_many_through.rb @@ -6,7 +6,7 @@ module ActiveRecord def associated_records_by_owner super.each do |owner, records| - records.uniq! if reflection_scope.uniq_value + records.uniq! if reflection_scope.distinct_value end end end |