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

@@ -10,6 +10,19 @@ class Booking < ApplicationRecord
has_many :booking_orders
has_many :orders, :through => :booking_orders
def self.update_dining_facility(booking_arr, newd, old)
booking_arr.each do |booking|
booking.dining_facility_id = newd
booking.save
end
new_dining = DiningFacility.find(newd)
new_dining.make_occupied
old_dining = DiningFacility.find(old)
old_dining.make_available
return new_dining.type
end
private
def generate_custom_id
self.booking_id = SeedGenerator.generate_id(self.class.name, "BKI")