aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlvaro Pereyra <alvaro@xendacentral.com>2012-05-28 01:45:33 -0500
committerAlvaro Pereyra <alvaro@xendacentral.com>2012-05-28 01:45:33 -0500
commitda4252f4a16bd3166866201a852f938263a3225c (patch)
tree10daf2f30a6ceda33cd119b8f7f933094143ed9d
parentfa6d921e11363e9b8c4bc10f7aed0b9faffdc33a (diff)
downloadrails-da4252f4a16bd3166866201a852f938263a3225c.tar.gz
rails-da4252f4a16bd3166866201a852f938263a3225c.tar.bz2
rails-da4252f4a16bd3166866201a852f938263a3225c.zip
Updates validations examples to be more attuned on the new Rails 3.0 conventions
-rw-r--r--activerecord/README.rdoc8
1 files 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]