Skip to content

Commit

Permalink
Use #dup when copying attributes hash
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt-Yorkley committed Jun 30, 2020
1 parent 57ba248 commit 707735b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/services/user_default_address_setter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ 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)
end

# 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)
Expand Down

0 comments on commit 707735b

Please sign in to comment.