1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

[ci skip] Add missing blank line to AR validation.

This commit is contained in:
Juanito Fatas 2014-10-25 21:33:15 +08:00
parent 8d7cf75684
commit 22166764cd

View file

@ -533,6 +533,7 @@ validates :boolean_field_name, presence: true
validates :boolean_field_name, inclusion: { in: [true, false] }
validates :boolean_field_name, exclusion: { in: [nil] }
```
By using one of these validations, you will ensure the value will NOT be `nil`
which would result in a `NULL` value in most cases.