Module: Mongoid::Validatable::Localizable
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/mongoid/validatable/localizable.rb |
Overview
Adds localization support to validations.
Instance Method Summary
-
#validate_each(document, attribute, value)
Validates each for localized fields.
Instance Method Details
#validate_each(document, attribute, value)
Validates each for localized fields.
# File 'lib/mongoid/validatable/localizable.rb', line 18
def validate_each(document, attribute, value) field = document.fields[document.database_field_name(attribute)] if field.try(:localized?) && !value.blank? value.values.each do |_value| super(document, attribute, _value) end else super end end