diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-08 15:33:10 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-08 15:33:10 -0700 |
commit | d0be8a04804fc6e7aa9fa762e4610760891fd5d1 (patch) | |
tree | 20a670f8f3e9322f39efd81789018549121c36b0 /activerecord/lib/active_record | |
parent | 2a2707f98bab66e2ad08fc7a75fabd6b1ee4153c (diff) | |
download | rails-d0be8a04804fc6e7aa9fa762e4610760891fd5d1.tar.gz rails-d0be8a04804fc6e7aa9fa762e4610760891fd5d1.tar.bz2 rails-d0be8a04804fc6e7aa9fa762e4610760891fd5d1.zip |
keys are always symbols
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb index 65131452ae..dbea122694 100644 --- a/activerecord/lib/active_record/associations/join_dependency.rb +++ b/activerecord/lib/active_record/associations/join_dependency.rb @@ -135,7 +135,7 @@ module ActiveRecord def remove_duplicate_results!(base, records, associations) case associations - when Symbol, String + when Symbol reflection = base.reflections[associations] remove_uniq_by_reflection(reflection, records) when Hash @@ -154,7 +154,9 @@ module ActiveRecord end end - remove_duplicate_results!(reflection.klass, parent_records, associations[name]) unless parent_records.empty? + unless parent_records.empty? + remove_duplicate_results!(reflection.klass, parent_records, associations[name]) + end end end end |