Displaying 1 result from an estimated 1 matches for "confirmationvalid".
2011 Jan 02
0
"Confirmation" succeeds when the *_confirmation attribute was neglected from the Model.
...attr_accessible :password #, :password_confirmation
validates(:password,
:confirmation => true,
:presence => true)
end
activemodel/lib/active_model/validations/confirmation.rb:
3 # == Active Model Confirmation Validator
4 module Validations
5 class ConfirmationValidator < EachValidator
6 def validate_each(record, attribute, value)
7 if (confirmed = record.send("#{attribute}_confirmation"))
&& (value != confirmed)
8 record.errors.add(attribute, :confirmation, options)
9 end
10 end
</pre&...