具有一个问号的数组的占位符

时间:2017-06-20 13:35:42

标签: ruby-on-rails

我正在尝试执行此查询:

counter = Issue.count('issue_status NOT IN (?) AND responsible_id IS NULL',
[CONST_A, CONST_B])

但是收到错误:

NoMethodError (undefined method `except' for [1529, 1535]:Array)

我的错误在哪里?

1 个答案:

答案 0 :(得分:0)

您的查询看起来不正确,我相信它应该是

counter = Issue.where('issue_status NOT IN (?) AND responsible_id IS NULL',
[CONST_A, CONST_B]).count