check customer

This commit is contained in:
phyusin
2018-06-05 15:38:42 +06:30
parent 8d4f85ff0c
commit dd58daa056
5 changed files with 17 additions and 18 deletions

View File

@@ -22,7 +22,7 @@ class OrderReservation < ApplicationRecord
else
gender = "Male"
end
if params[:customer_id].nil?
if params[:customer_id] && !params[:customer_id].nil?
customer = Customer.find(params[:customer_id])
else
customer = Customer.new
@@ -37,7 +37,6 @@ class OrderReservation < ApplicationRecord
customer.customer_type = "Doemal"
customer.tax_profiles = ["2"]
customer.save
# unless customer.valid?
# render json: {
# status: 422,