Module: CouchRest::Validation::ValidatesLength
- Included in:
- ClassMethods
- Defined in:
- lib/couchrest/validation/validators/length_validator.rb
Overview
class LengthValidator
Instance Method Summary collapse
- #validates_length(*fields) ⇒ Object
-
#validates_length_of(*fields) ⇒ Object
Validates that the length of the attribute is equal to, less than, greater than or within a certain range (depending upon the options you specify).
Instance Method Details
#validates_length(*fields) ⇒ Object
132 133 134 135 |
# File 'lib/couchrest/validation/validators/length_validator.rb', line 132 def validates_length(*fields) warn "[DEPRECATION] `validates_length` is deprecated. Please use `validates_length_of` instead." validates_length_of(*fields) end |
#validates_length_of(*fields) ⇒ Object
Validates that the length of the attribute is equal to, less than, greater than or within a certain range (depending upon the options you specify).
127 128 129 130 |
# File 'lib/couchrest/validation/validators/length_validator.rb', line 127 def validates_length_of(*fields) opts = opts_from_validator_args(fields) add_validator_to_context(opts, fields, CouchRest::Validation::LengthValidator) end |