Skip to content

Commit

Permalink
only use specialized Wings::WorkSearchBuilder if Wings is enabled
Browse files Browse the repository at this point in the history
`WorksControllerBehavior` offers the option to use it with
`curation_concern_type` that is a `Valkyrie::Resource`. in the event that one
does this, and `Wings` is turned on, it's necessary to provide a custom
search_builder_class to the controller to allow it to find resources indexed as
their mapped `ActiveFedora` objects.

that is, Valkyrie objects saved by Wings are indexed by ActiveFedora using model
names provided by AF.

none of this is needed if Valkyrie is handling the indexing, and the normal
search builder can be used in that case. so don't try to setup this class for
`.koppie` and in other cases where Wings is not in use.
  • Loading branch information
tamsin johnson committed Aug 30, 2023
1 parent f576b42 commit a25b59a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
include Hyrax::WorksControllerBehavior # rubocop:disable RSpec/DescribedClass

self.curation_concern_type = Hyrax::Test::SimpleWork
self.search_builder_class = Wings::WorkSearchBuilder(Hyrax::Test::SimpleWork)
self.search_builder_class = Wings::WorkSearchBuilder(Hyrax::Test::SimpleWork) unless
Hyrax.config.disable_wings
self.work_form_service = Hyrax::FormFactory.new
end

Expand Down

0 comments on commit a25b59a

Please sign in to comment.