From 5d6c6ec0996249d2d4a6dc8e144163125626db16 Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Tue, 9 Dec 2014 16:51:21 -0200 Subject: [PATCH] Adding information about 'allow_nil' option for 'numericality' [ci skip] --- guides/source/active_record_validations.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/guides/source/active_record_validations.md b/guides/source/active_record_validations.md index 546c0608ee..7628b8278d 100644 --- a/guides/source/active_record_validations.md +++ b/guides/source/active_record_validations.md @@ -487,6 +487,8 @@ constraints to acceptable values: * `:even` - Specifies the value must be an even number if set to true. The default error message for this option is _"must be even"_. +NOTE: By default, `numericality` doesn't allow `nil` values. You can use `allow_nil: true` option to permit it. + The default error message is _"is not a number"_. ### `presence`