I'm trying to get all the coupons with an expirationDate(date type) that are nil:
@coupons = @deal.coupons.all
@coupons = @coupons.where("expirationDate = ?", nil)
But for some reason the code above doesn't work. However, if instead I do:
@coupons = @deal.coupons.all
@coupons = @coupons.where(expirationDate: nil)
It gets all the nil coupons as I want it to. I'm confused as to why the first one doesn't work, but the second one does. Any help would be appreciated.