Class: Hyrax::MyHighlightsSearchBuilder

Inherits:
SearchBuilder
  • Object
show all
Includes:
MySearchBuilderBehavior
Defined in:
app/search_builders/hyrax/my_highlights_search_builder.rb

Overview

Added to allow for the My controller to show only things I have edit access to

Instance Method Summary collapse

Methods included from MySearchBuilderBehavior

#discovery_permissions

Methods inherited from SearchBuilder

#show_only_resources_deposited_by_current_user

Methods included from SearchFilters

#discovery_permissions, #gated_discovery_filters

Methods included from FilterSuppressed

#only_active_works

Methods included from FilterByType

#filter_models

Instance Method Details

#show_only_highlighted_works(solr_parameters) ⇒ Object



7
8
9
10
11
12
13
# File 'app/search_builders/hyrax/my_highlights_search_builder.rb', line 7

def show_only_highlighted_works(solr_parameters)
  ids = scope.current_user.trophies.pluck(:work_id)
  solr_parameters[:fq] ||= []
  solr_parameters[:fq] += [
    ActiveFedora::SolrQueryBuilder.construct_query_for_ids(ids)
  ]
end