From 2976054f17fbd35545b1657915870aafa10e3c0b Mon Sep 17 00:00:00 2001 From: Dana Jones Date: Fri, 10 May 2013 11:29:16 -0500 Subject: Fixed boolean validation example to use inclusion instead of presence on migrations guide --- guides/source/migrations.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'guides/source') 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 ``` -- cgit v1.2.3