diff options
| author | Dana Jones <djones@larkfarm.com> | 2013-05-10 11:29:16 -0500 |
|---|---|---|
| committer | Dana Jones <djones@larkfarm.com> | 2013-05-10 11:29:16 -0500 |
| commit | 2976054f17fbd35545b1657915870aafa10e3c0b (patch) | |
| tree | 381cd14e75bc4df65eb674e5fbad85bde7d54dcd | |
| parent | f65f4fa538724563ac7c69849fc43d471cd740af (diff) | |
| download | rails-2976054f17fbd35545b1657915870aafa10e3c0b.tar.gz rails-2976054f17fbd35545b1657915870aafa10e3c0b.tar.bz2 rails-2976054f17fbd35545b1657915870aafa10e3c0b.zip | |
Fixed boolean validation example to use inclusion instead of presence on migrations guide
| -rw-r--r-- | guides/source/migrations.md | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/guides/source/migrations.md b/guides/source/migrations.md index 9c92efd521..fcfc54a3d7 100644 --- a/guides/source/migrations.md +++ b/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 ``` |
