order fix for booking
This commit is contained in:
@@ -39,12 +39,11 @@ class Api::OrdersController < Api::ApiController
|
|||||||
# check booking id is already completed.
|
# check booking id is already completed.
|
||||||
booking = Booking.find(params[:booking_id])
|
booking = Booking.find(params[:booking_id])
|
||||||
if !booking.sale_id.nil?
|
if !booking.sale_id.nil?
|
||||||
if booking.sale.sale_status == "completed"
|
booking.sale.sale_status == "completed"
|
||||||
@order.new_booking = true
|
@order.new_booking = true
|
||||||
else
|
else
|
||||||
@order.new_booking = false
|
@order.new_booking = false
|
||||||
@order.booking_id = params[:booking_id]
|
@order.booking_id = params[:booking_id]
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class Order < ApplicationRecord
|
|||||||
table = DiningFacility.find(self.table_id)
|
table = DiningFacility.find(self.table_id)
|
||||||
table.status = "occupied"
|
table.status = "occupied"
|
||||||
table.save
|
table.save
|
||||||
else
|
else
|
||||||
booking = Booking.find(self.booking_id)
|
booking = Booking.find(self.booking_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user