Class: Schematron::SchematronFileValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- Schematron::SchematronFileValidator
- Defined in:
- app/models/schematron.rb
Overview
Internal validator class (preferred over validates_each bc YARD can't see validates_each)
Instance Method Summary (collapse)
-
- (Object) validate_each(record, attribute, value)
SchematronFile exists with digest == value.
Instance Method Details
- (Object) validate_each(record, attribute, value)
SchematronFile exists with digest == value
8 9 10 |
# File 'app/models/schematron.rb', line 8 def validate_each(record, attribute, value) record.errors.add(attribute, "must be associated with an extant SchematronFile") unless SchematronFile[value].is_a? SchematronFile end |