From 1e18ac077ac85fa1d7cf2c5689f4ec42b121e0d7 Mon Sep 17 00:00:00 2001 From: bohung Date: Mon, 20 Jul 2020 20:58:24 +0800 Subject: [PATCH] Fix cannot hire the empty time interval bug caused by the wrong data. --- app/models/property.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/property.rb b/app/models/property.rb index 42e9232..1bcaefa 100644 --- a/app/models/property.rb +++ b/app/models/property.rb @@ -100,7 +100,7 @@ class Property available = false end if available - bookings = phires.where(:recurring_end_date.gte => stime, :recurring => true) + phires.where(:recurring => false,:recurring_end_date => nil) + phires.where(:recurring => false,:recurring_end_date.gte => stime) + bookings = phires.where(:recurring_end_date.gte => stime, :recurring => true) case interval when 'week' d_step = 1.week