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

Update validate_numeric args #1392

Merged
merged 1 commit into from
Oct 5, 2024
Merged
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 src/actions/guides/database/callbacks_and_validations.cr
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class Guides::Database::CallbacksAndValidations < GuideAction
| validate_uniqueness_of | ensure a value doesn't exist in the database already | `validate_uniqueness_of email, query: UserQuery.new.email` |
| validate_at_most_one_filled | check that only 1 of the attributes has a value | `validate_at_most_one_filled choice1, choice2, choice3` |
| validate_exactly_one_filled | ensure exactly 1 attribute has a value | `validate_exactly_one_filled photo_id, video_id` |
| validate_numeric | ensure a number is within the range specified | `validate_numeric age, greater_than: 20, less_than: 30` |
| validate_numeric | ensure a number is within the range specified | `validate_numeric age, at_least: 20, no_more_than: 30` |
| validate_format_of | ensure a string matches a given regex | `validate_format_of email, with: /[^@]+@[^.]+..+/` |

> Note: non-nilable (required) fields automatically use `validate_required`.
Expand Down