Module: DataMapper::Validate::ValidatesWithMethod
- Included in:
- ClassMethods
- Defined in:
- lib/gems/dm-validations-0.9.9/lib/dm-validations/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>
61 62 63 64 |
# File 'lib/gems/dm-validations-0.9.9/lib/dm-validations/method_validator.rb', line 61 def validates_with_method(*fields) opts = opts_from_validator_args(fields) add_validator_to_context(opts, fields, DataMapper::Validate::MethodValidator) end |