From cc10dff1ad8f16386e860bd92fe930d2222ba695 Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Wed, 25 May 2011 21:44:38 +0530 Subject: changes validates_confirmation_of to newer syntax --- .../guides/source/active_record_validations_callbacks.textile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'railties/guides/source/active_record_validations_callbacks.textile') diff --git a/railties/guides/source/active_record_validations_callbacks.textile b/railties/guides/source/active_record_validations_callbacks.textile index fdc123fdae..618d02c9d3 100644 --- a/railties/guides/source/active_record_validations_callbacks.textile +++ b/railties/guides/source/active_record_validations_callbacks.textile @@ -208,7 +208,7 @@ You should use this helper when you have two text fields that should receive exa class Person < ActiveRecord::Base - validates_confirmation_of :email + validates :email, :confirmation => true end @@ -223,8 +223,8 @@ This check is performed only if +email_confirmation+ is not +nil+. To require co class Person < ActiveRecord::Base - validates_confirmation_of :email - validates_presence_of :email_confirmation + validates :email, :confirmation => true + validates :email_confirmation, :presence => true end @@ -547,7 +547,7 @@ Finally, it's possible to associate +:if+ and +:unless+ with a +Proc+ object whi class Account < ActiveRecord::Base - validates_confirmation_of :password, + validates :password, :confirmation => true, :unless => Proc.new { |a| a.password.blank? } end -- cgit v1.2.3