Class: Mongoid::Validations::FormatValidator
- Inherits:
-
ActiveModel::Validations::FormatValidator
- Object
- ActiveModel::Validations::FormatValidator
- Mongoid::Validations::FormatValidator
- Defined in:
- lib/mongoid/validations/format.rb
Overview
Validates that the specified attributes do or do not match a certain regular expression.
Instance Method Summary collapse
-
#validate_each(document, attribute, value) ⇒ Object
Validates each for format.
Instance Method Details
#validate_each(document, attribute, value) ⇒ Object
Validates each for format.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/mongoid/validations/format.rb', line 28 def validate_each(document, attribute, value) field = document.fields[attribute.to_s] if field && field.localized? && !value.blank? value.each_pair do |_locale, _value| super(document, attribute, _value) end else super end end |