提交 7408b6ec 编写于 作者: A Aaron Patterson

just grep the AST for OuterJoin nodes rather than converting the tree to SQL

上级 f1758525
......@@ -166,7 +166,7 @@ def perform_calculation(operation, column_name, options = {})
if operation == "count"
column_name ||= (select_for_count || :all)
if arel.join_sql =~ /LEFT OUTER/i
unless arel.ast.grep(Arel::Nodes::OuterJoin).empty?
distinct = true
column_name = @klass.primary_key if column_name == :all
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册