Method: Content::Validators::DescriptionFormat#validate_each
- Defined in:
- app/models/content/validators/description_format.rb
#validate_each(record, attribute, value) ⇒ Object
5 6 7 8 9 |
# File 'app/models/content/validators/description_format.rb', line 5 def validate_each(record, attribute, value) if value record.errors[attribute] << N_("cannot contain more than %s characters") % MAX_LENGTH unless value.length <= MAX_LENGTH end end |