I am having "Order" model with pickup_date, delivery_date and status. So i want to select orders -
- if status if picked_up then pickup_date should be some date value
(eg, '12/12/2012') - if status if delivered then delivery_date should be some date value
(eg, '12/12/2012')
I think we can use WHEN CASE with Activerecord. Can anybody help me in this?