So, I have an Event model that has a starts_at and a ends_at column and I want to find events that take place in a range of dates.
Event
starts_at
ends_at
I guess an event overlaps if it begins before the range ends and ends after the range begins. :)
So:
{:conditions => ['? < ends_at AND ? > starts_at', range.first, range.last]}