Sha256: 199e292f807d44ba463d27ff797b630a943f4bde8d31f076ee9c2478f6da1f18

Contents?: true

Size: 777 Bytes

Versions: 10

Compression:

Stored size: 777 Bytes

Contents

# frozen_string_literal: true

module GeoblacklightAdmin
  module PublicationStateSearchBehavior
    extend ActiveSupport::Concern

    included do
      self.default_processor_chain += [:publication_state_records]
    end

    ##
    # Show/Hide records by publication state in search
    # Defaults to "published" items only
    # publication_state: ['published', 'unpublished', 'draft']
    # @param [Blacklight::Solr::Request]
    # @return [Blacklight::Solr::Request]
    def publication_state_records(solr_params)
      solr_params[:fq] ||= []
      solr_params[:fq] << if blacklight_params["publication_state"]
        "b1g_publication_state_s:#{blacklight_params["publication_state"]}"
      else
        "b1g_publication_state_s:published"
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
geoblacklight_admin-0.7.0 app/models/concerns/geoblacklight_admin/publication_state_search_behavior.rb
geoblacklight_admin-0.6.3 app/models/concerns/geoblacklight_admin/publication_state_search_behavior.rb
geoblacklight_admin-0.6.2 app/models/concerns/geoblacklight_admin/publication_state_search_behavior.rb
geoblacklight_admin-0.6.1 app/models/concerns/geoblacklight_admin/publication_state_search_behavior.rb
geoblacklight_admin-0.6.0 app/models/concerns/geoblacklight_admin/publication_state_search_behavior.rb
geoblacklight_admin-0.5.1 app/models/concerns/geoblacklight_admin/publication_state_search_behavior.rb
geoblacklight_admin-0.5.0 app/models/concerns/geoblacklight_admin/publication_state_search_behavior.rb
geoblacklight_admin-0.4.2 app/models/concerns/geoblacklight_admin/publication_state_search_behavior.rb
geoblacklight_admin-0.4.1 app/models/concerns/geoblacklight_admin/publication_state_search_behavior.rb
geoblacklight_admin-0.4.0 app/models/concerns/geoblacklight_admin/publication_state_search_behavior.rb