From 7fd8f71ce0b8e0bf30b416d5b6425bb5b636ed76 Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Wed, 8 Jun 2011 04:48:03 +0530 Subject: fix incorrect validation examples --- .../guides/source/active_record_validations_callbacks.textile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/railties/guides/source/active_record_validations_callbacks.textile b/railties/guides/source/active_record_validations_callbacks.textile index 36094dcddc..50ff1c9ff7 100644 --- a/railties/guides/source/active_record_validations_callbacks.textile +++ b/railties/guides/source/active_record_validations_callbacks.textile @@ -182,7 +182,7 @@ It can receive an +:accept+ option, which determines the value that will be cons class Person < ActiveRecord::Base - validates :terms_of_service, :acceptance => true, :accept => 'yes' + validates :terms_of_service, :acceptance => { :accept => 'yes' } end @@ -338,7 +338,7 @@ WARNING. Note that the regular expression above allows a trailing newline charac class Player < ActiveRecord::Base validates :points, :numericality => true - validates :games_played, :numericality => true, :only_integer => true + validates :games_played, :numericality => { :only_integer => true } end @@ -393,8 +393,8 @@ There is a +:scope+ option that you can use to specify other attributes that are class Holiday < ActiveRecord::Base - validates :name, :uniqueness => true, :scope => :year, - :message => "should happen once per year" + validates :name, :uniqueness => { :scope => :year, + :message => "should happen once per year" } end @@ -402,7 +402,7 @@ There is also a +:case_sensitive+ option that you can use to define whether the class Person < ActiveRecord::Base - validates :name, :uniqueness => true, :case_sensitive => false + validates :name, :uniqueness => { :case_sensitive => false } end -- cgit v1.2.3