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

Added Decimal validations #3

Merged
merged 4 commits into from
Nov 10, 2023
Merged

Added Decimal validations #3

merged 4 commits into from
Nov 10, 2023

Conversation

madclaws
Copy link
Contributor

What?

Added validation functions for Decimals.

Why

Although Tarams library supports :decimal type, we were not able to do any validations against it like other types, since Valdi didn't have the validations defined.

How

After the added validations in Valdi, we can use the decimal validations in Tarams, for ex

    max_amount: [
      type: :decimal,
      required: true,
      decimal: [greater_than: Decimal.new("0.0"), less_than_or_equal_to: Decimal.new("99999")]
    ],

Testing

Added tests for all validation functions

@bluzky bluzky merged commit 53f1a0e into bluzky:main Nov 10, 2023
1 check failed
@bluzky
Copy link
Owner

bluzky commented Nov 10, 2023

@madclaws Thanks for your PR, I've just release Valdi 0.4.0 and new Tarams version

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.

2 participants