Commit c2d57046 authored by maeda's avatar maeda
Browse files

Add plugin directories to rails autoload paths (#30753).

Patch by Florian Schwab.

git-svn-id: e93f8b46-1217-0410-a6f0-8f06a7374b81
parent ff55186a
......@@ -107,11 +107,12 @@ module Redmine
# Adds the app/{controllers,helpers,models} directories of the plugin to the autoload path
Dir.glob File.expand_path(File.join(, 'app', '{controllers,helpers,models}')) do |dir|
ActiveSupport::Dependencies.autoload_paths += [dir]
Rails.application.config.eager_load_paths += [dir] if Rails.application.config.eager_load
# Add the plugin directories to rails autoload paths
engine_cfg =
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
ActiveSupport::Dependencies.autoload_paths += engine_cfg.eager_load_paths + engine_cfg.autoload_once_paths + engine_cfg.autoload_paths
# Defines plugin setting if present
if p.settings
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment