-
-
Save afred/dc99d18e9fe8dc1c77969b3df91ab0a9 to your computer and use it in GitHub Desktop.
(untested) another rough code sketch for how validating rdf types for Files within FileSets might work
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NOTE: class names, module names, and file paths will depend on which namespaces we decide to use. | |
# And the namespaces will depend on where we want them to live. There's no "right" answer for this. | |
# Just varying levels of "that makes sense" vs. "wtf?". | |
module Hyrax::Validations::FileRdfTypeValidation | |
extend ActiveSupport::Concern | |
included do | |
validate :validate_pcdm_file_rdf_types | |
end | |
def validate_pcdm_file_rdf_types | |
validates_with PcdmFileRdfTypeValidator | |
end | |
end | |
class Hyrax::Validators::PcdmFileRdfTypeValidator | |
def validate!() | |
# Read validation rules from config | |
# For each File within FileSet#files | |
# apply validation rules | |
end | |
end | |
# And then.. we'd add our new module to default FileSetBehavior within Hyrax | |
module Hyrax::FileSetBehavior | |
# this line is added | |
include Hyrax::Validations::FileRdfTypeValidation | |
end | |
# Or something along those lines... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment