I'm building a little Sinatra web app at the moment and having problems understanding queries with DataMapper.
I have a field in my database which I've called date, I'd love to query this and only return records from this current month.
I've tried this:
query = "2012-11"
@trips = Trip.all(:date.like => '%query%')
Which doesn't seem to work, I'm hoping someone might spot my error and give me some guidance! Hope someone can help, thanks for taking the time to read.
Dave