Sha256: 4e1970f5fa6734d7f31e5ba36aa90c36886e10bd5667c53816e4b7ce77810a85

Contents?: true

Size: 282 Bytes

Versions: 18

Compression:

Stored size: 282 Bytes

Contents

module Hydra::Works
  class NotCollectionValidator
    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
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
hydra-works-2.2.0 lib/hydra/works/not_collection_validator.rb
hydra-works-2.1.0 lib/hydra/works/not_collection_validator.rb
hydra-works-2.0.0 lib/hydra/works/not_collection_validator.rb
hydra-works-1.2.0 lib/hydra/works/not_collection_validator.rb
hydra-works-1.1.0 lib/hydra/works/not_collection_validator.rb
hydra-works-1.0.0 lib/hydra/works/not_collection_validator.rb
hydra-works-0.17.0 lib/hydra/works/not_collection_validator.rb
hydra-works-0.16.0 lib/hydra/works/not_collection_validator.rb
hydra-works-0.15.0 lib/hydra/works/not_collection_validator.rb
hydra-works-0.12.1 lib/hydra/works/not_collection_validator.rb
hydra-works-0.14.0 lib/hydra/works/not_collection_validator.rb
hydra-works-0.13.0 lib/hydra/works/not_collection_validator.rb
hydra-works-0.12.0 lib/hydra/works/not_collection_validator.rb
hydra-works-0.11.0 lib/hydra/works/not_collection_validator.rb
hydra-works-0.10.0 lib/hydra/works/not_collection_validator.rb
hydra-works-0.9.0 lib/hydra/works/not_collection_validator.rb
hydra-works-0.8.1 lib/hydra/works/not_collection_validator.rb
hydra-works-0.8 lib/hydra/works/not_collection_validator.rb