Sha256: 7290f437e0eda10384d57f95c7d43bd561e42845d06e91d8c119c3a79fe1690c

Contents?: true

Size: 296 Bytes

Versions: 9

Compression:

Stored size: 296 Bytes

Contents

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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
hydra-pcdm-0.9.0 lib/hydra/pcdm/validators/pcdm_validator.rb
hydra-pcdm-0.8.2 lib/hydra/pcdm/validators/pcdm_validator.rb
hydra-pcdm-0.8.1 lib/hydra/pcdm/validators/pcdm_validator.rb
hydra-pcdm-0.8.0 lib/hydra/pcdm/validators/pcdm_validator.rb
hydra-pcdm-0.8.0.beta1 lib/hydra/pcdm/validators/pcdm_validator.rb
hydra-pcdm-0.7.0 lib/hydra/pcdm/validators/pcdm_validator.rb
hydra-pcdm-0.6.0 lib/hydra/pcdm/validators/pcdm_validator.rb
hydra-pcdm-0.5.0 lib/hydra/pcdm/validators/pcdm_validator.rb
hydra-pcdm-0.4.0 lib/hydra/pcdm/validators/pcdm_validator.rb