check nil for cus info
This commit is contained in:
@@ -362,9 +362,9 @@ class Customer < ApplicationRecord
|
|||||||
customer = Customer.new
|
customer = Customer.new
|
||||||
customer.name = params[:name]
|
customer.name = params[:name]
|
||||||
customer.email = params[:email]
|
customer.email = params[:email]
|
||||||
customer.contact_no = params[:contact_no]
|
customer.contact_no = params[:contact_no] ? params[:contact_no] : ''
|
||||||
customer.gender = params[:gender]
|
customer.gender = gender
|
||||||
customer.address = params[:address]
|
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.date_of_birth = params[:date_of_birth] ? Time.parse(params[:date_of_birth]).strftime("%Y-%m-%d") : ''
|
||||||
customer.membership_id = params[:membership_id]
|
customer.membership_id = params[:membership_id]
|
||||||
customer.customer_type = "Takeaway"
|
customer.customer_type = "Takeaway"
|
||||||
|
|||||||
Reference in New Issue
Block a user