fix: currency being ignored for properties (#1556)

* fix: add property with different currency is not updating

* fix: add property with different currency test

* fix: code review

* fix: code review
This commit is contained in:
Thiago Diniz da Silveira
2026-04-29 13:47:32 +02:00
committed by GitHub
parent 9b2c80768c
commit c9f9e04071
4 changed files with 40 additions and 7 deletions

View File

@@ -62,8 +62,10 @@ module AccountableResource
end
end
# Update remaining account attributes
update_params = account_params.except(:return_to, :balance, :currency, :opening_balance_date)
# Update remaining account attributes. Note: currency is intentionally allowed
# here so all account types (depositories, credit cards, loans, etc.) can
# have their currency changed via this shared update path.
update_params = account_params.except(:return_to, :balance, :opening_balance_date)
unless @account.update(update_params)
@error_message = @account.errors.full_messages.join(", ")
render :edit, status: :unprocessable_entity