Module: DataMapper::Validate::ValidatesIsConfirmed
- Included in:
- ClassMethods
- Defined in:
- lib/gems/dm-validations-0.9.9/lib/dm-validations/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.
73 74 75 76 |
# File 'lib/gems/dm-validations-0.9.9/lib/dm-validations/confirmation_validator.rb', line 73 def validates_is_confirmed(*fields) opts = opts_from_validator_args(fields) add_validator_to_context(opts, fields, DataMapper::Validate::ConfirmationValidator) end |