diff options
author | Marius Balteanu <marius.balteanu@zitec.com> | 2021-11-17 20:55:08 +0000 |
---|---|---|
committer | Marius Balteanu <marius.balteanu@zitec.com> | 2021-11-17 20:55:08 +0000 |
commit | a914cf4c402b2597e0cc563bd84145ce9eda5a41 (patch) | |
tree | edb14ba9ebce182cb4f7cac808bfb49c6c504a46 /lib | |
parent | e82b0a77e348419bb4c4ed736ac126e22358eac0 (diff) | |
download | redmine-a914cf4c402b2597e0cc563bd84145ce9eda5a41.tar.gz redmine-a914cf4c402b2597e0cc563bd84145ce9eda5a41.zip |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/redmine/plugin_loader.rb | 8 | ||||
-rw-r--r-- | lib/redmine/twofa.rb | 2 |
2 files changed, 5 insertions, 5 deletions
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 |