Skip to content

Commit

Permalink
🚧 WIP to work with Valkyrie objects
Browse files Browse the repository at this point in the history
Changed the #iiif_print_config? to a class_attribute so we don't have to
instantiate the object to check if it's configured.  Added a next to the
indexer so if a curation concern does not have IIIF Print configured,
then we won't index the SetChildFlag onto it.
  • Loading branch information
kirkkwang committed Jan 4, 2024
1 parent cad2cf3 commit cc105d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/indexers/concerns/iiif_print/child_indexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ def self.decorate_work_types!
#

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

work_type.send(:include, IiifPrint::SetChildFlag) unless work_type.included_modules.include?(IiifPrint::SetChildFlag)
indexer = work_type.indexer
unless indexer.respond_to?(:iiif_print_lineage_service)
Expand Down
6 changes: 4 additions & 2 deletions lib/iiif_print.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,10 @@ def self.grandparent_for(file_set)
# an alternative splitting method to create new filesets on the existing work instead of new child works.
def self.model_configuration(**kwargs)
Module.new do
def iiif_print_config?
true
extend ActiveSupport::Concern

included do
class_attribute :iiif_print_config, default: true
end

# We don't know what you may want in your configuration, but from this gems implementation,
Expand Down

0 comments on commit cc105d0

Please sign in to comment.