Class: Hyrax::AdministrativeSet

Inherits:
Resource
  • Object
show all
Defined in:
app/models/hyrax/administrative_set.rb

Overview

Valkyrie model for Admin Set domain objects.

## Relationships

### Administrative Set and Work

  • Defined: The relationship is defined by the inverse relationship stored in the work’s ‘:admin_set_id` attribute.

  • Tested: The work tests the relationship.

  • Administrative Set to Work: (1..m) An admin set can have many works.

  • Work to Administrative Set: (1..1) A work must be in one and only one admin set.

    • See Hyrax::Work for code to get and set the admin set for the work.

Examples:

Get works in an admin set:

works = Hyrax.query_service.find_inverse_references_by(id: admin_set.id, property: :admin_set_id)

See Also:

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

#==, collection?, #collection?, #embargo, #embargo=, file?, #file?, file_set?, #file_set?, human_readable_type, #lease, #lease=, #pcdm_collection?, #pcdm_object?, pcdm_object?, #permission_manager, #to_rdf_representation, to_rdf_representation, #visibility, #visibility=, #work?, work?

Methods included from WithEvents

#event_class, #events, #log_event, #stream

Class Method Details

._hyrax_default_name_classClass

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns an ActiveModel::Name compatible class.

Returns:

  • (Class)

    an ActiveModel::Name compatible class



49
50
51
# File 'app/models/hyrax/administrative_set.rb', line 49

def self._hyrax_default_name_class
  Hyrax::AdministrativeSetName
end

.pcdm_collection?Boolean

Returns true.

Returns:

  • (Boolean)

    true



36
37
38
# File 'app/models/hyrax/administrative_set.rb', line 36

def self.pcdm_collection?
  true
end

Instance Method Details

#collection_type_gidObject



40
41
42
43
# File 'app/models/hyrax/administrative_set.rb', line 40

def collection_type_gid
  # allow AdministrativeSet to behave more like a regular PcdmCollection
  Hyrax::CollectionType.find_or_create_admin_set_type.to_global_id
end