Skip to content

Commit

Permalink
Blacklist timestamp attributes when assigning for update
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt-Yorkley committed Jun 30, 2020
1 parent 707735b commit a1c423c
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.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)
end

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

0 comments on commit a1c423c

Please sign in to comment.