Module: CouchRest::Validation::ValidatesIsConfirmed
- Included in:
- ClassMethods
- Defined in:
- lib/couchrest/validation/validators/confirmation_validator.rb
Overview
class ConfirmationValidator
Instance Method Summary collapse
-
#validates_is_confirmed(*fields) ⇒ Object
Validates that the given attribute is confirmed by another attribute.
Instance Method Details
#validates_is_confirmed(*fields) ⇒ Object
Validates that the given attribute is confirmed by another attribute. A common use case scenario is when you require a user to confirm their password, for which you use both password and password_confirmation attributes.
92 93 94 95 |
# File 'lib/couchrest/validation/validators/confirmation_validator.rb', line 92 def validates_is_confirmed(*fields) opts = opts_from_validator_args(fields) add_validator_to_context(opts, fields, CouchRest::Validation::ConfirmationValidator) end |