From 660025994d4c37ffe5f3886e408a63759ad7c426 Mon Sep 17 00:00:00 2001 From: Dave Riddle Date: Sun, 27 May 2018 19:58:42 -0700 Subject: [PATCH] Allow common house times that touch --- app/models/common_house_reservation.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/common_house_reservation.rb b/app/models/common_house_reservation.rb index a0b629e..1cd5092 100644 --- a/app/models/common_house_reservation.rb +++ b/app/models/common_house_reservation.rb @@ -37,8 +37,8 @@ def period_is_free errors.add(:base, "Time period is already taken") if CommonHouseReservation .where(community_id: community_id) .where.not(id: id) - .where("start_date <= ?", end_date) - .where("end_date >= ?", start_date) + .where("start_date < ?", end_date) + .where("end_date > ?", start_date) .exists? end