aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-10-08 15:33:10 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-10-08 15:33:10 -0700
commitd0be8a04804fc6e7aa9fa762e4610760891fd5d1 (patch)
tree20a670f8f3e9322f39efd81789018549121c36b0 /activerecord/lib/active_record/associations
parent2a2707f98bab66e2ad08fc7a75fabd6b1ee4153c (diff)
downloadrails-d0be8a04804fc6e7aa9fa762e4610760891fd5d1.tar.gz
rails-d0be8a04804fc6e7aa9fa762e4610760891fd5d1.tar.bz2
rails-d0be8a04804fc6e7aa9fa762e4610760891fd5d1.zip
keys are always symbols
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r--activerecord/lib/active_record/associations/join_dependency.rb6
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