提交 d69949ed 编写于 作者: A Aaron Patterson

Shouldn't have committed this! Revert "avoid calling to_sql twice"

This reverts commit 1c030a3c.
上级 1c030a3c
...@@ -135,14 +135,11 @@ def build_arel ...@@ -135,14 +135,11 @@ def build_arel
next if where.blank? next if where.blank?
case where case where
when Arel::Predicates::In when Arel::SqlLiteral
# FIXME: this needs to go away arel = arel.where(where)
# when an IN is part of a larger query, the SQL seems to be different
arel = arel.where(Arel::SqlLiteral.new("(#{where.to_sql})"))
when String
arel = arel.where(Arel::SqlLiteral.new("(#{where})"))
else else
arel = arel.where where sql = where.is_a?(String) ? where : where.to_sql
arel = arel.where(Arel::SqlLiteral.new("(#{sql})"))
end end
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册