Skip to content

Commit

Permalink
Update validate_numeric args (#1392)
Browse files Browse the repository at this point in the history
  • Loading branch information
snadon authored Oct 5, 2024
1 parent f39641c commit b8a325d
Showing 1 changed file with 1 addition and 1 deletion.
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

0 comments on commit b8a325d

Please sign in to comment.