We have a grid control that allows a user to filter text in different fields. A number of these fields might be timestamps, like created_at and updated_at.
Now, a user can do many different types of filters, including >, <, >=, <=, etc. So, a query that comes across from the control might look like:
"created_at > 2009", or "created_at >= 2006 and created_at <= 2010".
The database doesn't recognize years as valid timestamps, nor does rails automatically convert them as such. Are there any plugins or idiomatic ways to accomplish taking a year, or better yet, portion of a timestamp, making a best guess at the meaning, and converting it into a usable database timestamp?