move table

This commit is contained in:
Nweni
2017-06-21 17:53:44 +06:30
parent b889603ce6
commit 64210f30ac
16 changed files with 218 additions and 40 deletions

View File

@@ -19,11 +19,10 @@ class DiningFacility < ApplicationRecord
end
def get_current_booking
puts "enter 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}' and checkout_at is null").limit(1)
if booking.count > 0 then
return booking[0].booking_id
return booking[0]
else
return nil
end