1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

changes validates_confirmation_of to newer syntax

This commit is contained in:
Vijay Dev 2011-05-25 21:44:38 +05:30
parent 084750c2d0
commit cc10dff1ad

View file

@ -208,7 +208,7 @@ You should use this helper when you have two text fields that should receive exa
<ruby>
class Person < ActiveRecord::Base
validates_confirmation_of :email
validates :email, :confirmation => true
end
</ruby>
@ -223,8 +223,8 @@ This check is performed only if +email_confirmation+ is not +nil+. To require co
<ruby>
class Person < ActiveRecord::Base
validates_confirmation_of :email
validates_presence_of :email_confirmation
validates :email, :confirmation => true
validates :email_confirmation, :presence => true
end
</ruby>
@ -547,7 +547,7 @@ Finally, it's possible to associate +:if+ and +:unless+ with a +Proc+ object whi
<ruby>
class Account < ActiveRecord::Base
validates_confirmation_of :password,
validates :password, :confirmation => true,
:unless => Proc.new { |a| a.password.blank? }
end
</ruby>