From 707735bc7981ef929d7986896b321131e44c98fc Mon Sep 17 00:00:00 2001
From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com>
Date: Mon, 29 Jun 2020 19:54:28 +0200
Subject: [PATCH] Use #dup when copying attributes hash

---
 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 7a83078290e0..0746bae8cf8b 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.clone.attributes
+    new_bill_address = @order.bill_address.dup.attributes
 
     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.clone.attributes
+    new_ship_address = @order.ship_address.dup.attributes
 
     set_ship_address_attributes(@current_user, new_ship_address)
     set_ship_address_attributes(@order.customer, new_ship_address)