Permalink
Browse files

Updates validations examples to be more attuned on the new Rails 3.0 …

…conventions
  • Loading branch information...
1 parent fa6d921 commit da4252f4a16bd3166866201a852f938263a3225c @alvaropereyra alvaropereyra committed May 28, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 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]

0 comments on commit da4252f

Please sign in to comment.