mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-06 07:29:16 +00:00
Merge pull request #10184 from abdellani/fix-zeitwork-load-exception
prevent loading the reporting module if already loaded [dev environment]
This commit is contained in:
@@ -156,6 +156,7 @@ module Openfoodnetwork
|
||||
initializer "ofn.reports" do |app|
|
||||
module ::Reporting; end
|
||||
Rails.application.reloader.to_prepare do
|
||||
next if defined?(::Reporting) && defined?(::Reporting::Errors)
|
||||
loader = Zeitwerk::Loader.new
|
||||
loader.push_dir("#{Rails.root}/lib/reporting", namespace: ::Reporting)
|
||||
loader.enable_reloading
|
||||
|
||||
Reference in New Issue
Block a user