Class: Hydra::PCDM::Validators::PCDMValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/hydra/pcdm/validators/pcdm_validator.rb

Class Method Summary collapse

Class Method Details

.validate!(_reflection, record) ⇒ Object

Raises:

  • (ActiveFedora::AssociationTypeMismatch)


3
4
5
6
# File 'lib/hydra/pcdm/validators/pcdm_validator.rb', line 3

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