Module: CouchRest::Validation::ValidatesIsConfirmed
- Included in:
- ClassMethods
- Defined in:
- lib/couchrest/validation/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.
- #validates_is_confirmed(*fields) ⇒ Object
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.
92 93 94 95 |
# File 'lib/couchrest/validation/validators/confirmation_validator.rb', line 92 def validates_confirmation_of(*fields) opts = opts_from_validator_args(fields) add_validator_to_context(opts, fields, CouchRest::Validation::ConfirmationValidator) end |
#validates_is_confirmed(*fields) ⇒ Object
97 98 99 100 |
# File 'lib/couchrest/validation/validators/confirmation_validator.rb', line 97 def validates_is_confirmed(*fields) warn "[DEPRECATION] `validates_is_confirmed` is deprecated. Please use `validates_confirmation_of` instead." validates_confirmation_of(*fields) end |