Class: Mongoid::Validatable::FormatValidator

Inherits:
ActiveModel::Validations::FormatValidator
  • Object
show all
Includes:
Localizable
Defined in:
build/mongoid-7.4/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

Method Summary

Methods included from Localizable

#validate_each