1
0
Fork 0
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:
Dana Jones 2013-05-10 11:29:16 -05:00
parent f65f4fa538
commit 2976054f17

View file

@ -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
```