aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorDana Jones <djones@larkfarm.com>2013-05-10 11:29:16 -0500
committerDana Jones <djones@larkfarm.com>2013-05-10 11:29:16 -0500
commit2976054f17fbd35545b1657915870aafa10e3c0b (patch)
tree381cd14e75bc4df65eb674e5fbad85bde7d54dcd /guides
parentf65f4fa538724563ac7c69849fc43d471cd740af (diff)
downloadrails-2976054f17fbd35545b1657915870aafa10e3c0b.tar.gz
rails-2976054f17fbd35545b1657915870aafa10e3c0b.tar.bz2
rails-2976054f17fbd35545b1657915870aafa10e3c0b.zip
Fixed boolean validation example to use inclusion instead of presence on migrations guide
Diffstat (limited to 'guides')
-rw-r--r--guides/source/migrations.md5
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
```