reducing use of custom joins

This commit is contained in:
Aaron Patterson
2010-12-08 10:29:52 -08:00
parent 1d96d44da3
commit 2fd385d471

View File

@@ -296,7 +296,12 @@ module ActiveRecord
if Arel::Table === relation
relation.from(ast || relation)
else
relation.join(custom_joins)
if relation.froms.length > 0 && ast
ast.left = relation.froms.first
relation.from ast
else
relation.join(custom_joins)
end
end
end