Module: DataMapper::Validations::ValidatesConfirmation
- Extended by:
- Deprecate
- Included in:
- ClassMethods
- Defined in:
- lib/dm-validations/validators/confirmation_validator.rb
Overview
class ConfirmationValidator
Instance Method Summary collapse
-
#validates_confirmation_of(*fields) ⇒ Object
Validates that the given attribute is confirmed by another attribute.
Instance Method Details
#validates_confirmation_of(*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.
84 85 86 |
# File 'lib/dm-validations/validators/confirmation_validator.rb', line 84 def validates_confirmation_of(*fields) validators.add(ConfirmationValidator, *fields) end |