check nil for cus info

This commit is contained in:
phyusin
2018-05-11 13:39:32 +06:30
parent ae5ced251b
commit a76f9068da

View File

@@ -362,9 +362,9 @@ class Customer < ApplicationRecord
customer = Customer.new
customer.name = params[:name]
customer.email = params[:email]
customer.contact_no = params[:contact_no]
customer.gender = params[:gender]
customer.address = params[:address]
customer.contact_no = params[:contact_no] ? params[:contact_no] : ''
customer.gender = gender
customer.address = params[:address] ? params[:address] : ''
customer.date_of_birth = params[:date_of_birth] ? Time.parse(params[:date_of_birth]).strftime("%Y-%m-%d") : ''
customer.membership_id = params[:membership_id]
customer.customer_type = "Takeaway"