我尝试查询排除作为cookie保存的id的数组列表。
让我陷入困境where('author_name iLIKE ? OR quote iLIKE ? AND id NOT IN ?', "%#{search}%", "%#{search}%", "#{disable}").all(:order => sorting)
从上面的代码中,它将生成此SQL语句:
SELECT * FROM quotations WHERE author_name LIKE '%' + 'search' + '%' OR quote LIKE '%' + 'search' + '%' AND id NOT IN (1,2,3)