Skip to content

Commit

Permalink
changes validates_confirmation_of to newer syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
vijaydev committed May 25, 2011
1 parent 084750c commit cc10dff
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ You should use this helper when you have two text fields that should receive exa


<ruby> <ruby>
class Person < ActiveRecord::Base class Person < ActiveRecord::Base
validates_confirmation_of :email validates :email, :confirmation => true
end end
</ruby> </ruby>


Expand All @@ -223,8 +223,8 @@ This check is performed only if +email_confirmation+ is not +nil+. To require co


<ruby> <ruby>
class Person < ActiveRecord::Base class Person < ActiveRecord::Base
validates_confirmation_of :email validates :email, :confirmation => true
validates_presence_of :email_confirmation validates :email_confirmation, :presence => true
end end
</ruby> </ruby>


Expand Down Expand Up @@ -547,7 +547,7 @@ Finally, it's possible to associate +:if+ and +:unless+ with a +Proc+ object whi


<ruby> <ruby>
class Account < ActiveRecord::Base class Account < ActiveRecord::Base
validates_confirmation_of :password, validates :password, :confirmation => true,
:unless => Proc.new { |a| a.password.blank? } :unless => Proc.new { |a| a.password.blank? }
end end
</ruby> </ruby>
Expand Down

0 comments on commit cc10dff

Please sign in to comment.