From 290708ce3dd4ef17f6dd74f442ef04e1f943db0d Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Wed, 8 Jun 2011 04:48:03 +0530 Subject: [PATCH] fix incorrect validation examples Conflicts: railties/guides/source/active_record_validations_callbacks.textile --- .../active_record_validations_callbacks.textile | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/railties/guides/source/active_record_validations_callbacks.textile b/railties/guides/source/active_record_validations_callbacks.textile index f8cd2db250..4dcf731d2d 100644 --- a/railties/guides/source/active_record_validations_callbacks.textile +++ b/railties/guides/source/active_record_validations_callbacks.textile @@ -182,7 +182,7 @@ The default error message for +validates_acceptance_of+ is "_must be accepted_". class Person < ActiveRecord::Base - validates_acceptance_of :terms_of_service, :accept => 'yes' + validates :terms_of_service, :acceptance => { :accept => 'yes' } end @@ -336,8 +336,13 @@ WARNING. Note that the regular expression above allows a trailing newline charac class Player < ActiveRecord::Base +<<<<<<< HEAD validates_numericality_of :points validates_numericality_of :games_played, :only_integer => true +======= + validates :points, :numericality => true + validates :games_played, :numericality => { :only_integer => true } +>>>>>>> 7fd8f71... fix incorrect validation examples end @@ -392,8 +397,13 @@ There is a +:scope+ option that you can use to specify other attributes that are class Holiday < ActiveRecord::Base +<<<<<<< HEAD validates_uniqueness_of :name, :scope => :year, :message => "should happen once per year" +======= + validates :name, :uniqueness => { :scope => :year, + :message => "should happen once per year" } +>>>>>>> 7fd8f71... fix incorrect validation examples end @@ -401,7 +411,11 @@ There is also a +:case_sensitive+ option that you can use to define whether the class Person < ActiveRecord::Base +<<<<<<< HEAD validates_uniqueness_of :name, :case_sensitive => false +======= + validates :name, :uniqueness => { :case_sensitive => false } +>>>>>>> 7fd8f71... fix incorrect validation examples end