Skip to content
This repository has been archived by the owner on Apr 17, 2020. It is now read-only.

On address update, only delete old uneditable address if new one is saved #79

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/spree/addresses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def update
else
new_address = @address.clone
new_address.attributes = address_params
@address.update_attribute(:deleted_at, Time.now)
if new_address.save
@address.update_attribute(:deleted_at, Time.now)
flash[:notice] = I18n.t(:successfully_updated, scope: :address_book)
redirect_back_or_default(account_path)
else
Expand Down