Sha256: 207f3ba38d4e58e0a99f948d65c1732638cb487ce8260c1cad4bb61e1d462f76
Contents?: true
Size: 734 Bytes
Versions: 24
Compression:
Stored size: 734 Bytes
Contents
# frozen_string_literal: true module Wings module CustomQueries ## # @see Hyrax::CustomQueries::FindCollectionsByType class FindCollectionsByType def self.queries [:find_collections_by_type] end def initialize(query_service:) @query_service = query_service end attr_reader :query_service delegate :resource_factory, to: :query_service ## # @param global_id [GlobalID] global id for a Hyrax::CollectionType # # @return [Enumerable<PcdmCollection>] def find_collections_by_type(global_id:) ::Collection.where(Hyrax.config.collection_type_index_field.to_sym => global_id.to_s).map(&:valkyrie_resource) end end end end
Version data entries
24 entries across 24 versions & 1 rubygems