Skip to content

Commit

Permalink
♻️ Restore decoration based on work types
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyf committed Jan 22, 2024
1 parent 7cde6af commit fc96714
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 5 additions & 3 deletions app/indexers/concerns/iiif_print/child_indexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ module ChildIndexer
def self.decorate_work_types!
# TODO: This method is in the wrong location; says indexing but there's also the SetChildFlag
# consideration. Consider refactoring this stuff into a single nested module.
#

Hyrax.config.curation_concerns.each do |work_type|
next unless work_type.respond_to?(:iiif_print_config?)
next unless work_type.iiif_print_config?

IiifPrint.decorate_with_adapter_logic(work_type: work_type)
if work_type < Valkyrie::Resource
IiifPrint::PersistenceLayer::ValkyrieAdapter.decorate_with_adapter_logic(work_type: work_type)
else
IiifPrint::PersistenceLayer::ActiveFedoraAdapter.decorate_with_adapter_logic(work_type: work_type)
end

indexer.prepend(self).class_attribute(:iiif_print_lineage_service, default: IiifPrint::LineageService) unless indexer.respond_to?(:iiif_print_lineage_service)
work_type::GeneratedResourceSchema.send(:include, IiifPrint::SetChildFlag) if work_type.const_defined?(:GeneratedResourceSchema)
Expand Down
1 change: 0 additions & 1 deletion lib/iiif_print.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class << self

delegate(
:clean_for_tests!,
:decorate_with_adapter_logic,
:destroy_children_split_from,
:grandparent_for,
:object_in_works,
Expand Down

0 comments on commit fc96714

Please sign in to comment.