Skip to content

Commit

Permalink
manager will always be a manager
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Dec 10, 2010
1 parent 82944b9 commit 4dec00a
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions activerecord/lib/active_record/relation/query_methods.rb
Expand Up @@ -270,17 +270,13 @@ def build_joins(manager, joins)
manager = association.join_to(manager)
end

if Arel::Table === manager
manager.from(join_ast || manager)
if manager.froms.length > 0 && join_ast
join_ast.left = manager.froms.first
manager.from join_ast
elsif manager.froms.length == 0 && join_ast
manager.from(join_ast)
else
if manager.froms.length > 0 && join_ast
join_ast.left = manager.froms.first
manager.from join_ast
elsif manager.froms.length == 0 && join_ast
manager.from(join_ast)
else
manager
end
manager
end
end

Expand Down

0 comments on commit 4dec00a

Please sign in to comment.