提交 49e4dcbd 编写于 作者: A Aaron Patterson

PERF: avoid *args

上级 f87c8398
......@@ -15,7 +15,9 @@ def christener
def select_sql
if relation.projections.first.is_a?(Count) && relation.projections.size == 1 &&
(relation.taken.present? || relation.wheres.present?) && relation.joins(self).blank?
subquery = build_query("SELECT 1 FROM #{relation.from_clauses}", build_clauses)
subquery = [
"SELECT 1 FROM #{relation.from_clauses}", build_clauses
].join ' '
query = "SELECT COUNT(*) AS count_id FROM (#{subquery}) AS subquery"
else
query = [
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册