尝试重写此条款:
where("authorized_at IS NOT NULL OR paid_at IS NOT NULL")
到那个更漂亮的人:
where.not(authorized_at: nil, paid_at: nil)
但是产生" authorized_at IS NOT NULL AND paid_at IS NOT NULL"。有没有办法用where.not重写它?
答案 0 :(得分:0)
我能得到的最好的是:
where.not("authorized_at IS NULL AND paid_at IS NULL")
奇怪的是哈希对应的工作方式不一样......