123456789_123456789_123456789_123456789_123456789_

Class: Mongoid::Validatable::FormatValidator

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, ActiveModel::Validations::FormatValidator
Instance Chain:
self, Localizable, ActiveModel::Validations::FormatValidator
Inherits: ActiveModel::Validations::FormatValidator
  • Object
Defined in: lib/mongoid/validatable/format.rb

Overview

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

Examples:

::Set up the format validator.

class Person
  include Mongoid::Document
  field :website

  validates_format_of :website, :with => URI.regexp
end

Instance Method Summary

Localizable - Included

#validate_each

Validates each for localized fields.