From a1c423c01b3524bc89d126b617583a0eee1fa8f7 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 30 Jun 2020 09:12:49 +0200 Subject: [PATCH] Blacklist timestamp attributes when assigning for update --- app/services/user_default_address_setter.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/user_default_address_setter.rb b/app/services/user_default_address_setter.rb index 0746bae8cf8b..20a80afc3d38 100644 --- a/app/services/user_default_address_setter.rb +++ b/app/services/user_default_address_setter.rb @@ -9,7 +9,7 @@ def initialize(order, current_user) # Sets the order bill address as the user default bill address def set_default_bill_address - new_bill_address = @order.bill_address.dup.attributes + new_bill_address = @order.bill_address.dup.attributes.except!('created_at', 'updated_at') set_bill_address_attributes(@current_user, new_bill_address) set_bill_address_attributes(@order.customer, new_bill_address) @@ -17,7 +17,7 @@ def set_default_bill_address # Sets the order ship address as the user default ship address def set_default_ship_address - new_ship_address = @order.ship_address.dup.attributes + new_ship_address = @order.ship_address.dup.attributes.except!('created_at', 'updated_at') set_ship_address_attributes(@current_user, new_ship_address) set_ship_address_attributes(@order.customer, new_ship_address)