Module: CouchRest::Validation::ValidatesWithMethod
- Included in:
- ClassMethods
- Defined in:
- lib/couchrest/validation/validators/method_validator.rb
Overview
class MethodValidator
Instance Method Summary collapse
-
#validates_with_method(*fields) ⇒ Object
Validate using the given method.
Instance Method Details
#validates_with_method(*fields) ⇒ Object
Validate using the given method. The method given needs to return:
- result::<Boolean>, Error Message::<String>
82 83 84 85 |
# File 'lib/couchrest/validation/validators/method_validator.rb', line 82 def validates_with_method(*fields) opts = opts_from_validator_args(fields) add_validator_to_context(opts, fields, CouchRest::Validation::MethodValidator) end |