mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
reducing use of custom joins
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user