Add plugin lib directory to rails autoload paths (#30753).

git-svn-id: http://svn.redmine.org/redmine/trunk@17958 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2019-03-15 07:58:07 +00:00
parent 8d7386c3fa
commit 2010cdc1a3

View File

@ -111,6 +111,7 @@ module Redmine
# Add the plugin directories to rails autoload paths
engine_cfg = Rails::Engine::Configuration.new(p.directory)
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