Sha256: 21cd2fe8f838525b78fa7ced0a6868230d1c1cd784dd0b9073ee608070195070

Contents?: true

Size: 500 Bytes

Versions: 10

Compression:

Stored size: 500 Bytes

Contents

# Added to allow for the My controller to show only things I have edit access to
class Hyrax::MyHighlightsSearchBuilder < Hyrax::SearchBuilder
  include Hyrax::MySearchBuilderBehavior

  self.default_processor_chain += [:show_only_highlighted_works]

  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
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
hyrax-1.1.1 app/search_builders/hyrax/my_highlights_search_builder.rb
hyrax-1.1.0 app/search_builders/hyrax/my_highlights_search_builder.rb
hyrax-1.0.5 app/search_builders/hyrax/my_highlights_search_builder.rb
hyrax-1.0.4 app/search_builders/hyrax/my_highlights_search_builder.rb
hyrax-1.0.3 app/search_builders/hyrax/my_highlights_search_builder.rb
hyrax-1.0.2 app/search_builders/hyrax/my_highlights_search_builder.rb
hyrax-1.0.1 app/search_builders/hyrax/my_highlights_search_builder.rb
hyrax-1.0.0.rc2 app/search_builders/hyrax/my_highlights_search_builder.rb
hyrax-1.0.0.rc1 app/search_builders/hyrax/my_highlights_search_builder.rb
test_hyrax-0.0.1.alpha app/search_builders/hyrax/my_highlights_search_builder.rb