Method: AWS::Record::Validations#validates_length_of
- Defined in:
- lib/aws/record/validations.rb
#validates_length_of(*attributes, options = {}, &block) ⇒ Object
Validates the attribute values are of a specified length.
validates_lenth_of :username, :within => 3..25
Length vs Count
validates_length_of validates the length of individual attribute
values, whereas +validates_count_of: validates the number of
attribute values.
If you need to ensure there are certain number of values see #validates_count_of instead.
597 598 599 |
# File 'lib/aws/record/validations.rb', line 597 def validates_length_of *args validators << LengthValidator.new(self, *args) end |