0001-adds-lib-directory-of-plugins-to-eager_load_paths.patch

Jens Krämer, 2019-03-08 05:31

Download (1.12 KB)

View differences:

lib/redmine/plugin.rb
114 114
      Rails.application.config.autoload_paths += engine_cfg.autoload_paths
115 115
      ActiveSupport::Dependencies.autoload_paths += engine_cfg.eager_load_paths + engine_cfg.autoload_once_paths + engine_cfg.autoload_paths
116 116

  
117
      # Adds the lib/ directory of the plugin to the auto / eagerload path
118
      lib = File.expand_path(File.join(p.directory, 'lib'))
119
      if File.directory?(lib)
120
        ActiveSupport::Dependencies.autoload_paths += [lib]
121
        Rails.application.config.eager_load_paths += [lib] if Rails.application.config.eager_load
122
      end
123

  
117 124
      # Defines plugin setting if present
118 125
      if p.settings
119 126
        Setting.define_plugin_setting p
120
-