Model .where("TSRANGE(?, ?, '()') && TSRANGE(starts_at, ends_at, '()')", starts_at, ends_at) .where.not(id: record_id) .exists?
Both starts_at and ends_at columns should be indexed.
starts_at
ends_at
Empty! You must sign in to add comments.
None
Comments
Empty! You must sign in to add comments.