Sha256: 62e02aa12c92b0292b4c1d562ecd45473a135f4f86e96fc2f20da770e54a6cde

Contents?: true

Size: 721 Bytes

Versions: 48

Compression:

Stored size: 721 Bytes

Contents

module Qa::Authorities
  class FindWorks < Qa::Authorities::Base
    class_attribute :search_builder_class
    self.search_builder_class = Hyrax::My::FindWorksSearchBuilder

    def search(_q, controller)
      # The My::FindWorksSearchBuilder expects a current_user
      return [] unless controller.current_user
      repo = CatalogController.new.repository
      builder = search_builder(controller)
      response = repo.search(builder)
      docs = response.documents
      docs.map do |doc|
        id = doc.id
        title = doc.title
        { id: id, label: title, value: id }
      end
    end

    private

      def search_builder(controller)
        search_builder_class.new(controller)
      end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
hyrax-2.3.3 app/authorities/qa/authorities/find_works.rb
hyrax-2.3.2 app/authorities/qa/authorities/find_works.rb
hyrax-2.3.1 app/authorities/qa/authorities/find_works.rb
hyrax-2.3.0 app/authorities/qa/authorities/find_works.rb
hyrax-2.0.3 app/authorities/qa/authorities/find_works.rb
hyrax-2.2.4 app/authorities/qa/authorities/find_works.rb
hyrax-2.2.3 app/authorities/qa/authorities/find_works.rb
hyrax-2.2.2 app/authorities/qa/authorities/find_works.rb
hyrax-2.2.1 app/authorities/qa/authorities/find_works.rb
hyrax-2.2.0 app/authorities/qa/authorities/find_works.rb
hyrax-2.1.0 app/authorities/qa/authorities/find_works.rb
hyrax-2.1.0.rc4 app/authorities/qa/authorities/find_works.rb
hyrax-2.1.0.rc3 app/authorities/qa/authorities/find_works.rb
hyrax-2.1.0.rc2 app/authorities/qa/authorities/find_works.rb
hyrax-2.1.0.rc1 app/authorities/qa/authorities/find_works.rb
hyrax-2.1.0.beta2 app/authorities/qa/authorities/find_works.rb
hyrax-2.0.2 app/authorities/qa/authorities/find_works.rb
hyrax-2.1.0.beta1 app/authorities/qa/authorities/find_works.rb
hyrax-2.0.1 app/authorities/qa/authorities/find_works.rb
hyrax-2.0.0 app/authorities/qa/authorities/find_works.rb