diff options
author | Marcel Molina <marcel@vernix.org> | 2007-12-05 15:04:06 +0000 |
---|---|---|
committer | Marcel Molina <marcel@vernix.org> | 2007-12-05 15:04:06 +0000 |
commit | b4337c236e20cec0ec2c5e7b57e76e41bc69b84d (patch) | |
tree | cb7fd6c3cd06e553d597ed2bc6d4efd3e8208835 /activerecord | |
parent | 228186d94a4f70f0e1febeb6c9899e884ec5aba1 (diff) | |
download | rails-b4337c236e20cec0ec2c5e7b57e76e41bc69b84d.tar.gz rails-b4337c236e20cec0ec2c5e7b57e76e41bc69b84d.tar.bz2 rails-b4337c236e20cec0ec2c5e7b57e76e41bc69b84d.zip |
Add documentation about the virtual attribute added by validates_confirmation_of and its behavior. Closes #8815 [JEG2, matt, kampers]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8288 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/CHANGELOG | 2 | ||||
-rwxr-xr-x | activerecord/lib/active_record/validations.rb | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index 05edae46a9..14ce50536e 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Add documentation about the virtual attribute added by validates_confirmation_of and its behavior. Closes #8815 [JEG2, matt, kampers] + * Add documentation for freeze and readonly related methods. Closes #8878 [pelargir, jeremymcanally] * Document the timestamps schema definition method. Closes #9000 [mikong] diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb index 3b8ffe4e06..79e009a413 100755 --- a/activerecord/lib/active_record/validations.rb +++ b/activerecord/lib/active_record/validations.rb @@ -383,9 +383,12 @@ module ActiveRecord # <%= password_field "person", "password" %> # <%= password_field "person", "password_confirmation" %> # - # The person has to already have a password attribute (a column in the people table), but the password_confirmation is virtual. - # It exists only as an in-memory variable for validating the password. This check is performed only if password_confirmation - # is not nil and by default on save. + # The added +password_confirmation+ attribute is virtual; it exists only as an in-memory attribute for validating the password. + # To achieve this, the validation adds acccessors to the model for the confirmation attribute. NOTE: This check is performed + # only if +password_confirmation+ is not nil, and by default only on save. To require confirmation, make sure to add a presence + # check for the confirmation attribute: + # + # validates_presence_of :password_confirmation, :if => :password_changed? # # Configuration options: # * <tt>message</tt> - A custom error message (default is: "doesn't match confirmation") |