From a914cf4c402b2597e0cc563bd84145ce9eda5a41 Mon Sep 17 00:00:00 2001 From: Marius Balteanu Date: Wed, 17 Nov 2021 20:55:08 +0000 Subject: Switch to zeitwerk autoloader (#29914, #32938). Patch by Takashi Kato. git-svn-id: http://svn.redmine.org/redmine/trunk@21287 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/plugin_loader.rb | 8 ++++---- lib/redmine/twofa.rb | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/redmine/plugin_loader.rb b/lib/redmine/plugin_loader.rb index 3009560e2..43219a116 100644 --- a/lib/redmine/plugin_loader.rb +++ b/lib/redmine/plugin_loader.rb @@ -89,7 +89,7 @@ module Redmine def self.create_assets_reloader plugin_assets_dirs = {} - @plugin_directories.each do |dir| + directories.each do |dir| plugin_assets_dirs[dir.assets_dir] = ['*'] end ActiveSupport::FileUpdateChecker.new([], plugin_assets_dirs) do @@ -123,9 +123,9 @@ module Redmine # Add the plugin directories to rails autoload paths engine_cfg = Rails::Engine::Configuration.new(directory.to_s) engine_cfg.paths.add 'lib', eager_load: true - Rails.application.config.eager_load_paths += engine_cfg.eager_load_paths - Rails.application.config.autoload_once_paths += engine_cfg.autoload_once_paths - Rails.application.config.autoload_paths += engine_cfg.autoload_paths + engine_cfg.eager_load_paths.each do |dir| + Rails.autoloaders.main.push_dir dir + end end end diff --git a/lib/redmine/twofa.rb b/lib/redmine/twofa.rb index 612cdec99..cfa0ea422 100644 --- a/lib/redmine/twofa.rb +++ b/lib/redmine/twofa.rb @@ -55,7 +55,7 @@ module Redmine def self.scan_builtin_schemes Dir[Rails.root.join('lib', 'redmine', 'twofa', '*.rb')].each do |file| - require_dependency file + require file end end private_class_method :scan_builtin_schemes -- cgit v1.2.3