I'm getting the error while comparing two dates in ruby on rails, I'm using PostgreSQL as my database.
exp_date = ps.expiry_date
if Date.today < Date.parse(exp_date)
Good
else
Expired
exp_date
variable contains 2014-07-31
value from database.
But while I'm running this code it's giving this error "can't convert Date into String
" in the 2nd line of my code snippet. But when using directly the date as 2014-07-31
, it's working. Please help me to find out where I'm wrong.