2014-09-23 87 views
1

试图改写这一条款:轨道4至where.not和OR

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 paid_at IS NOT空值”。没有办法用where.not重写它吗?

回答

0

尽我所能得到是:

where.not("authorized_at IS NULL AND paid_at IS NULL") 

奇怪的是哈希对方将无法正常工作一样...