123456789_123456789_123456789_123456789_123456789_

Class: Mongoid::Validatable::LengthValidator

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, ActiveModel::Validations::LengthValidator
Instance Chain:
self, Localizable, ActiveModel::Validations::LengthValidator
Inherits: ActiveModel::Validations::LengthValidator
  • Object
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

Instance Method Summary

Localizable - Included

#validate_each

Validates each for localized fields.