From da4252f4a16bd3166866201a852f938263a3225c Mon Sep 17 00:00:00 2001 From: Alvaro Pereyra Date: Mon, 28 May 2012 01:45:33 -0500 Subject: Updates validations examples to be more attuned on the new Rails 3.0 conventions --- activerecord/README.rdoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/activerecord/README.rdoc b/activerecord/README.rdoc index 30a66ff5f0..d080e0b0f5 100644 --- a/activerecord/README.rdoc +++ b/activerecord/README.rdoc @@ -61,10 +61,10 @@ A short rundown of some of the major features: * Validation rules that can differ for new or existing objects. class Account < ActiveRecord::Base - validates_presence_of :subdomain, :name, :email_address, :password - validates_uniqueness_of :subdomain - validates_acceptance_of :terms_of_service, :on => :create - validates_confirmation_of :password, :email_address, :on => :create + validates :subdomain, :name, :email_address, :password, presence: true + validates :subdomain, uniqueness: true + validates :terms_of_service, acceptance: true, on: :create + validates :password, :email_address, confirmation: true, on: :create end {Learn more}[link:classes/ActiveRecord/Validations.html] -- cgit v1.2.3