Skip to content

Commit

Permalink
Workaround zeitwerk and engine_cart issue
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcolvar committed Oct 2, 2024
1 parent 6cdb736 commit 36f5b6e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/hydra/role_management.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ class Engine < ::Rails::Engine
# Rails 4 should do this automatically:
config.paths.add 'app/controllers/concerns', eager_load: true
config.paths.add 'app/models/concerns', eager_load: true

config.before_configuration do
# rubocop:disable Style/IfUnlessModifier
# see https://github.com/fxn/zeitwerk#for_gem
# Blacklight puts a generator into LOCAL APP lib/generators, so tell
# zeitwerk to ignore the whole directory? If we're using zeitwerk
#
# See: https://github.com/cbeer/engine_cart/issues/117
if ::Rails.try(:autoloaders).try(:main).respond_to?(:ignore)
::Rails.autoloaders.main.ignore(::Rails.root.join('lib', 'generators'))
end
end
end
end
end

0 comments on commit 36f5b6e

Please sign in to comment.