From a175ce3aebd6e28651d245d5a0506d51be8f42fd Mon Sep 17 00:00:00 2001 From: Yan Date: Thu, 16 Nov 2017 21:14:59 +0630 Subject: [PATCH] temp fix get current booking --- app/models/dining_facility.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/dining_facility.rb b/app/models/dining_facility.rb index 9463738b..1130003e 100755 --- a/app/models/dining_facility.rb +++ b/app/models/dining_facility.rb @@ -32,7 +32,7 @@ class DiningFacility < ApplicationRecord end def get_current_booking - booking = Booking.where("dining_facility_id = #{self.id} and booking_status ='assign' and checkin_at between '#{DateTime.now.utc - 5.hours}' and '#{DateTime.now.utc}'").limit(1) #and checkout_at is null + booking = Booking.where("dining_facility_id = #{self.id} and booking_status ='assign' and checkin_at between '#{DateTime.now.utc - 5.hours}' and '#{DateTime.now.utc}' and checkout_by is null").limit(1) #and checkout_at is null if booking.count > 0 then return booking[0] else