Sha256: 323a4053be0c19e0f45fc8949f736347233776b073db9c3b95dd4c13c334b786

Contents?: true

Size: 295 Bytes

Versions: 4

Compression:

Stored size: 295 Bytes

Contents

module Hydra::PCDM::Validators
  class PCDMValidator
    def self.validate!(_reflection, record)
      if !record.try(:pcdm_object?) && !record.try(:pcdm_collection?)
        fail ActiveFedora::AssociationTypeMismatch, "#{record} is not a PCDM object or collection."
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hydra-pcdm-0.3.2 lib/hydra/pcdm/validators/pcdm_validator.rb
hydra-pcdm-0.3.1 lib/hydra/pcdm/validators/pcdm_validator.rb
hydra-pcdm-0.3.0 lib/hydra/pcdm/validators/pcdm_validator.rb
hydra-pcdm-0.2.0 lib/hydra/pcdm/validators/pcdm_validator.rb