Class: Hydra::Works::NotCollectionValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/hydra/works/not_collection_validator.rb

Class Method Summary collapse

Class Method Details

.validate!(_association, record) ⇒ Object



3
4
5
6
7
# File 'lib/hydra/works/not_collection_validator.rb', line 3

def self.validate!(_association, record)
  if record.try(:collection?)
    raise ActiveFedora::AssociationTypeMismatch, "#{record} is a Collection and may not be a member of the association"
  end
end