move whole table
This commit is contained in:
@@ -8,6 +8,16 @@ class DiningFacility < ApplicationRecord
|
||||
|
||||
scope :active, -> {where(is_active: true)}
|
||||
|
||||
def make_available
|
||||
self.status = 'available'
|
||||
self.save
|
||||
end
|
||||
|
||||
def make_occupied
|
||||
self.status = 'occupied'
|
||||
self.save
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user