Module: Blacklight::SearchContext

Extended by:
ActiveSupport::Concern
Included in:
Catalog, SearchHistory
Defined in:
app/controllers/concerns/blacklight/search_context.rb

Instance Method Summary collapse

Instance Method Details

#current_search_sessionObject

The current search session



22
23
24
# File 'app/controllers/concerns/blacklight/search_context.rb', line 22

def current_search_session
  @current_search_session ||= find_search_session
end

#searches_from_historyObject

Returns a list of Searches from the ids in the user’s history.



27
28
29
# File 'app/controllers/concerns/blacklight/search_context.rb', line 27

def searches_from_history
  session[:history].blank? ? ::Search.none : ::Search.where(id: session[:history]).order("updated_at desc")
end