diff --git a/lib/dm-core/query.rb b/lib/dm-core/query.rb index df9da306..fb6fd17e 100644 --- a/lib/dm-core/query.rb +++ b/lib/dm-core/query.rb @@ -925,7 +925,7 @@ def normalize_links @links.clear - while link = links.shift + while link = links.pop relationship = case link when Symbol, String then @relationships[link] when Associations::Relationship then link @@ -961,6 +961,7 @@ def normalize_links @links << relationship end end + @links.reverse! end # Append conditions to this Query