Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(wallet): Validate currency #2999

Merged
merged 1 commit into from
Dec 23, 2024
Merged

fix(wallet): Validate currency #2999

merged 1 commit into from
Dec 23, 2024

Conversation

vincent-pochet
Copy link
Collaborator

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

Copy link
Collaborator

@rsempe rsempe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@vincent-pochet vincent-pochet merged commit 274faaa into main Dec 23, 2024
6 checks passed
@vincent-pochet vincent-pochet deleted the fix-wallet-validation branch December 23, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants