Skip to content

Commit

Permalink
Add workaround for engine_cart-generated generator conflicting with R…
Browse files Browse the repository at this point in the history
…ails 7.1 zeitwerk default config.

cbeer/engine_cart#117
  • Loading branch information
jrochkind committed Nov 8, 2023
1 parent 651b918 commit b330632
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/qa/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,16 @@
module Qa
class Engine < ::Rails::Engine
isolate_namespace Qa

config.before_configuration do
# 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.autoloaders&.main.respond_to?(:ignore)
Rails.autoloaders.main.ignore(Rails.root.join('lib/generators'))
end
end
end
end

0 comments on commit b330632

Please # to comment.