Module: DataMapper::Validations::ValidatesWithin
- Included in:
- ClassMethods
- Defined in:
- lib/dm-validations/validators/within_validator.rb
Overview
class WithinValidator
Instance Method Summary collapse
-
#validates_within(*fields) ⇒ Object
Validates that the value of a field is within a range/set.
Instance Method Details
#validates_within(*fields) ⇒ Object
Validates that the value of a field is within a range/set.
This validation is defined by passing a field along with a :set parameter. The :set can be a Range or any object which responds to the #include? method (an array, for example).
69 70 71 |
# File 'lib/dm-validations/validators/within_validator.rb', line 69 def validates_within(*fields) validators.add(WithinValidator, *fields) end |