如何使用 Squeel 编写 SQL 查询?
SELECT * FROM documents where (NOT document.deleted OR document.deleted IS NULL)
我试过:
Document.where { (-deleted) | (deleted == nil) }
但得到这个错误:
NoMethodError: undefined method `|' for deleted.-@:Squeel::Nodes::KeyPath