Skip to content

Commit

Permalink
we always have a reflection and it is on the node
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Oct 11, 2013
1 parent 5bef5cf commit 68c0811
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -149,7 +149,7 @@ def deep_copy(parent, node)


def remove_duplicate_results!(base, records, associations) def remove_duplicate_results!(base, records, associations)
associations.each do |node| associations.each do |node|
reflection = base.reflect_on_association(node.name) reflection = node.reflection
remove_uniq_by_reflection(reflection, records) remove_uniq_by_reflection(reflection, records)


parent_records = [] parent_records = []
Expand Down Expand Up @@ -189,7 +189,7 @@ def build_scalar(reflection, parent, join_type)
end end


def remove_uniq_by_reflection(reflection, records) def remove_uniq_by_reflection(reflection, records)
if reflection && reflection.collection? if reflection.collection?
records.each { |record| record.send(reflection.name).target.uniq! } records.each { |record| record.send(reflection.name).target.uniq! }
end end
end end
Expand Down

0 comments on commit 68c0811

Please sign in to comment.