Skip to content

Commit

Permalink
Update engine
Browse files Browse the repository at this point in the history
  • Loading branch information
kirkkwang committed Jul 3, 2024
1 parent 6ce1ecd commit da485d7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/hyku_knapsack/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def self.load_translations!
# only add the migrations if they are not already copied
# via the rake task. Allows gem to work both with the install:migrations
# and without it.
if !app.root.to_s.match(HykuKnapsack::Engine.root.to_s) &&
if app.root.to_s != HykuKnapsack::Engine.root.to_s &&
app.root.join('db/migrate').children.none? { |path| path.fnmatch?("*.hyku_knapsack.rb") }
config.paths["db/migrate"].expanded.each do |expanded_path|
app.config.paths["db/migrate"] << expanded_path
Expand All @@ -43,17 +43,22 @@ def self.load_translations!
# omniauthable
# ]
# end

# Ensure we are prepending the Hyrax::SimpleSchemaLoaderDecorator early
Hyrax::SimpleSchemaLoader.prepend(Hyrax::SimpleSchemaLoaderDecorator)
end

config.after_initialize do
config.to_prepare do
HykuKnapsack::Engine.root.glob("app/**/*_decorator*.rb").sort.each do |c|
Rails.configuration.cache_classes ? require(c) : load(c)
end

HykuKnapsack::Engine.root.glob("lib/**/*_decorator*.rb").sort.each do |c|
Rails.configuration.cache_classes ? require(c) : load(c)
end
end

config.after_initialize do
Hyrax::DerivativeService.services = [
IiifPrint::PluggableDerivativeService
]
Expand Down

0 comments on commit da485d7

Please sign in to comment.