From 23b8fbbbc7da102f527746b8f8dc8126a8d03008 Mon Sep 17 00:00:00 2001 From: Bing Xie Date: Fri, 16 Sep 2016 14:43:14 +1000 Subject: [PATCH] Update customer's default address --- app/controllers/checkout_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/checkout_controller.rb b/app/controllers/checkout_controller.rb index dedbd87e53..643af0063e 100644 --- a/app/controllers/checkout_controller.rb +++ b/app/controllers/checkout_controller.rb @@ -65,7 +65,7 @@ class CheckoutController < Spree::CheckoutController if params[:order][:default_bill_address] == 'YES' new_bill_address = @order.bill_address.clone spree_current_user.set_bill_address(new_bill_address) - @order.customer.update_attribute(:bill_address, new_bill_address) unless @order.customer.bill_address + @order.customer.bill_address.andand.update_attributes(new_bill_address.attributes) end end @@ -74,7 +74,7 @@ class CheckoutController < Spree::CheckoutController if params[:order][:default_ship_address] == 'YES' new_ship_address = @order.ship_address.clone spree_current_user.set_ship_address(new_ship_address) - @order.customer.update_attribute(:ship_address, new_ship_address) unless @order.customer.ship_address + @order.customer.ship_address.andand.update_attributes(new_ship_address.attributes) end end