I build my simple blog system and every article in the system has two inputs for setting the the, from that the article will be visible for the visitors and the second input is for the date, till that will be visited.
For example, if I will set to this inputs the values
2011-10-25 and 2011-10-28, so that's mean, the article will be visible 3 days. If I wanted to have an article still visible, so I would like to have in inputs the values 0000-00-00.
But now I think how to make an sql query - I try something like:
Article.where('from_date <= ? AND to_date >= ?', Func.today, Func.today)
This works me if I have set a date, from that and till that I want to have an article visible. But if I will set that I want to have an article visible everytime (0000-00-00), so this query doesn't works...
I would like to ask you about the hint, how to update the sql query above for it...
Thanks in advance,
Manny