Module: MixedContentValidatable
- Defined in:
- backend/app/model/mixins/mixed_content_validatable.rb
Instance Method Summary collapse
-
#validate_mixed_content_field(field = :title) ⇒ Object
Adds a validation error to the given field (default :title) for invalid EAD markup.
Instance Method Details
#validate_mixed_content_field(field = :title) ⇒ Object
Adds a validation error to the given field (default :title) for invalid EAD markup.
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'backend/app/model/mixins/mixed_content_validatable.rb', line 6 def validate_mixed_content_field(field = :title) value = begin respond_to?(field) ? send(field) : self[field] rescue self[field] end return if value.nil? || value.to_s.strip.empty? if (msg = MixedContentValidator.error_for_inline_ead(value)) errors.add(field, msg) end end |