mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fixed boolean validation example to use inclusion instead of presence on migrations guide
This commit is contained in:
parent
f65f4fa538
commit
2976054f17
1 changed files with 3 additions and 2 deletions
|
@ -852,7 +852,7 @@ end
|
|||
# app/models/product.rb
|
||||
|
||||
class Product < ActiveRecord::Base
|
||||
validates :flag, presence: true
|
||||
validates :flag, :inclusion => { :in => [true, false] }
|
||||
end
|
||||
```
|
||||
|
||||
|
@ -877,7 +877,8 @@ end
|
|||
# app/models/product.rb
|
||||
|
||||
class Product < ActiveRecord::Base
|
||||
validates :flag, :fuzz, presence: true
|
||||
validates :flag, :inclusion => { :in => [true, false] }
|
||||
validates :fuzz, presence: true
|
||||
end
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in a new issue