【发布时间】:2013-12-27 08:47:51
【问题描述】:
我正在开发一个 Rails 3.2 应用程序并使用姿势作为数据库。
以下由 Active Record 生成的查询不起作用。生成这个查询的代码在这个问题Scope for an optional has_one association with itself中。
SELECT "indents".* FROM "indents" WHERE "indents"."type" IN ('Purchase') AND
(id not in (NULL,15017)) ORDER BY indent_date DESC
但如果我手动删除 NULL 并尝试,它可以工作。
SELECT "indents".* FROM "indents" WHERE "indents"."type" IN ('Purchase') AND
(id not in (15017)) ORDER BY indent_date DESC
这里有什么问题?
【问题讨论】:
标签: sql ruby-on-rails postgresql activerecord null