Sha256: 21c3f4355abbcf5a69fbde67906272ac09d6adb943eed099e2bdf6bc255caefc
Contents?: true
Size: 950 Bytes
Versions: 28
Compression:
Stored size: 950 Bytes
Contents
# frozen_string_literal: true module Hyrax # Builds a query to find the members of an admin set. # For use on the admin menu, so it includes works regardless of status. class AdminAdminSetMemberSearchBuilder < ::SearchBuilder self.default_processor_chain += [:in_admin_set] self.default_processor_chain -= [:only_active_works] attr_reader :collection ## # @param [Object] scope Typically the controller object # @param [::Collection] collection def initialize(scope:, collection:) @collection = collection super(scope) end ## # include filters into the query to only include the admin_set members (regardless of status) # # @param [Hash] solr_parameters # # @return [void] def in_admin_set(solr_parameters) solr_parameters[:fq] ||= [] solr_parameters[:fq] << "{!term f=#{Hyrax.config.admin_set_predicate.qname.last}_ssim}#{collection.id}" end end end
Version data entries
28 entries across 28 versions & 1 rubygems