Skip to content

Commit

Permalink
⚙️ Utilize Hyrax's schema search paths config
Browse files Browse the repository at this point in the history
As of Hyrax `9d8d5f8`, there is now a configuration for the
`Hyrax::SimpleSchemaLoader` that allows us to do away with the need for
a decorator.  I'm leaving it there for applications that aren't at
`9d8d5f8` yet but guard it.

Ref:
  - samvera/hyrax@9d8d5f8
  • Loading branch information
kirkkwang committed Aug 12, 2024
1 parent 273057f commit fba9f8c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/services/iiif_print/simple_schema_loader_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ def config_search_paths
end
end
end
Hyrax::SimpleSchemaLoader.prepend(IiifPrint::SimpleSchemaLoaderDecorator)
Hyrax::SimpleSchemaLoader.prepend(IiifPrint::SimpleSchemaLoaderDecorator) unless Hyrax.config.respond_to?(:simple_schema_loader_config_search_paths)
2 changes: 2 additions & 0 deletions lib/iiif_print/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ class Engine < ::Rails::Engine
config.callback.set(:after_create_fileset) do |file_set, user|
IiifPrint.config.handle_after_create_fileset(file_set, user)
end

config.simple_schema_loader_config_search_paths += [IiifPrint::Engine.root]
end
end
# rubocop:enable Metrics/BlockLength
Expand Down

0 comments on commit fba9f8c

Please sign in to comment.