-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(wallet): Validate currency (#2999)
## Context This PR is related to ``` ActiveRecord::NotNullViolation PG::NotNullViolation: ERROR: null value in column "balance_currency" of relation "wallets" violates not-null constraint (ActiveRecord::NotNullViolation) ``` The error is raised when creating a wallet with a null currency if the related customer does not have a currency. ## Description The PR - Add a validation on `wallet#currency` making sure it is included in the accepted currency list. - Avoid updating the customer currency with a nil value
- Loading branch information
1 parent
db1da6a
commit 274faaa
Showing
3 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters