Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Commit

Permalink
When building the join logic, do not use include the first link
Browse files Browse the repository at this point in the history
* This adds an unecessary join to the statement, and can also cause some
  aliasing issues in self referrential joins.  The aliasing problem will
  still need to be resolved for very complex joins, but this makes the
  joins for m:m associations more efficient in the meantime.
  • Loading branch information
dkubb committed Jun 7, 2009
1 parent 7429143 commit 716a689
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/dm-core/adapters/data_objects_adapter.rb
Expand Up @@ -439,7 +439,7 @@ def join_statement(query, qualify)

statement = ''

query.links.reverse_each do |relationship|
query.links[0..-1].reverse_each do |relationship|
model = if relationship.source_model == previous_model
relationship.target_model
else
Expand Down

0 comments on commit 716a689

Please sign in to comment.