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)