Sha256: 5c6cf3a18b305030724776bac05ff228cb3b59c29e65525f90ed4b256e3dc22f

Contents?: true

Size: 494 Bytes

Versions: 28

Compression:

Stored size: 494 Bytes

Contents

# frozen_string_literal: true

module Spotlight
  # Override Blacklight::SearchState to use exhibit-specific routes for documents
  class SearchState < SimpleDelegator
    attr_reader :current_exhibit

    def initialize(search_state, current_exhibit)
      super(search_state)
      @current_exhibit = current_exhibit
    end

    def url_for_document(document, options = {})
      return super unless current_exhibit

      [controller.spotlight, current_exhibit, document]
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
blacklight-spotlight-3.6.0.beta9 lib/spotlight/search_state.rb
blacklight-spotlight-3.6.0.beta8 lib/spotlight/search_state.rb
blacklight-spotlight-3.6.0.beta7 lib/spotlight/search_state.rb
blacklight-spotlight-3.6.0.beta6 lib/spotlight/search_state.rb
blacklight-spotlight-3.6.0.beta5 lib/spotlight/search_state.rb
blacklight-spotlight-3.6.0.beta4 lib/spotlight/search_state.rb
blacklight-spotlight-3.6.0.beta3 lib/spotlight/search_state.rb
blacklight-spotlight-3.6.0.beta1 lib/spotlight/search_state.rb