Skip to content
Browse files

Fixed boolean validation example to use inclusion instead of presence…

… on migrations guide
  • Loading branch information...
1 parent f65f4fa commit 2976054f17fbd35545b1657915870aafa10e3c0b @danabrit danabrit committed
Showing with 3 additions and 2 deletions.
  1. +3 −2 guides/source/migrations.md
View
5 guides/source/migrations.md
@@ -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
```

0 comments on commit 2976054

Please sign in to comment.
Something went wrong with that request. Please try again.