From b928c31c7e1faf17b221f855393f17cf70fccf1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Nadon?= Date: Fri, 4 Oct 2024 23:28:37 -0400 Subject: [PATCH] Update validate_numeric args --- src/actions/guides/database/callbacks_and_validations.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/actions/guides/database/callbacks_and_validations.cr b/src/actions/guides/database/callbacks_and_validations.cr index cacbb76f..450c5f71 100644 --- a/src/actions/guides/database/callbacks_and_validations.cr +++ b/src/actions/guides/database/callbacks_and_validations.cr @@ -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`.