Class: Mongoid::Validatable::LengthValidator

Inherits:
ActiveModel::Validations::LengthValidator
  • Object
show all
Includes:
Localizable
Defined in:
lib/mongoid/validatable/length.rb

Overview

Validates that the specified attributes do or do not match a certain length.

Examples:

Set up the length validator.


class Person
  include Mongoid::Document
  field :website

  validates_length_of :website, in: 1..10
end

Method Summary

Methods included from Localizable

#validate_each