the parent hash keeps the records unique already

This commit is contained in:
Aaron Patterson 2013-10-11 18:48:43 -07:00
parent cfbb6eeb4c
commit b69b9de4bd

@ -105,14 +105,13 @@ def instantiate(result_set)
}
}
records = result_set.map { |row_hash|
result_set.each { |row_hash|
primary_id = type_caster.type_cast row_hash[primary_key]
parent = parents[primary_id] ||= join_root.instantiate(row_hash)
construct(parent, join_root, row_hash, result_set, seen)
parent
}.uniq
}
records
parents.values
end
private