2014-09-23 83 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") 

奇怪的是哈希對方將無法正常工作一樣...