Class: EtiquetteValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- EtiquetteValidator
- Defined in:
- app/validators/etiquette_validator.rb
Overview
This validator takes care of ensuring the validated content is respectful, doesn’t use caps, and overall is meaningful.
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
6 7 8 9 10 11 12 |
# File 'app/validators/etiquette_validator.rb', line 6 def validate_each(record, attribute, value) return if value.blank? validate_caps(record, attribute, value) validate_marks(record, attribute, value) validate_caps_first(record, attribute, value) end |