move whole table

This commit is contained in:
Nweni
2017-06-21 05:36:58 +06:30
parent f69bee9b03
commit fa309fb89a
12 changed files with 558 additions and 8 deletions

View File

@@ -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)