seed generator
This commit is contained in:
@@ -18,7 +18,7 @@ class Booking < ApplicationRecord
|
||||
booking = TableBooking.new
|
||||
booking.booking_id = b['booking_id']
|
||||
booking.dining_facility_id = b['dining_facility_id']
|
||||
booking.type = b['type']
|
||||
# booking.type = b['type']
|
||||
booking.checkin_at = b['checkin_at']
|
||||
booking.checkin_by = b['checkin_by']
|
||||
booking.checkout_at = b['checkout_at']
|
||||
@@ -97,7 +97,7 @@ class Booking < ApplicationRecord
|
||||
.joins('left join sale_orders on sale_orders.order_id=assigned_order_items.order_id')
|
||||
.where('sale_orders.sale_id=?', sale_id)
|
||||
|
||||
@bookings = Booking.where('sale_id=?', sale_id)
|
||||
@bookings = TableBooking.where('sale_id=?', sale_id)
|
||||
|
||||
@sales = Sale.where("sale_id=?", sale_id)
|
||||
|
||||
@@ -120,6 +120,11 @@ class Booking < ApplicationRecord
|
||||
|
||||
private
|
||||
def generate_custom_id
|
||||
self.booking_id = SeedGenerator.generate_id(self.class.name, "BKI")
|
||||
prefix = "BKI"
|
||||
if ENV["SERVER_MODE"] == 'cloud'
|
||||
prefix = "CBKI"
|
||||
end
|
||||
|
||||
self.booking_id = SeedGenerator.generate_id(self.class.name, prefix)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user