lib/blacklight/engine.rb in blacklight-8.0.1 vs lib/blacklight/engine.rb in blacklight-8.1.0
- old
+ new
@@ -4,9 +4,21 @@
module Blacklight
class Engine < Rails::Engine
engine_name "blacklight"
+ 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 a recent
+ # enough version of Rails to have zeitwerk config
+ #
+ # 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
+
config.after_initialize do
Blacklight::Configuration.initialize_default_configuration
end
# This makes our rake tasks visible.