searchlogic
searchlogic copied to clipboard
Chain scopes with "and"
Let's say I've got a list of events. I want to find out which events were active at a certain date. So I run:
Event.start_date_lte('2010-01-01').end_date_gte('2010-01-01')
And everything works fine.
Now I'd like to use a form so the user can enter the date, and I'd like to generate this search using just one input field. So it would be nice if I could just do:
Event.start_date_lte_and_end_date_gte('2010-01-01')
Just the same way the same it is possible with 'OR'.
If you find it useful, consider implementing it in the future.
Thanks.