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