Project

General

Profile

Actions

Patch #30725

closed

Plugin eager_load should depend on environment setting instead of name

Added by Florian Schwab about 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Rails support
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Currently the app directories are added to the eager_load paths if the environment name is production.

see: source:trunk/lib/redmine/plugin.rb@17293#96

The decision to add the path to the eager_load paths should depend on the_ eager_load_ setting (Rails.application.config.eager_load) instead of the environment name.
Rails 5 disables autoloading in case eager_load is enabled so using a different environment (e.g. staging) that also enables eager_load will result in plugin classes (e.g. models) are not loaded (uninitialized constant) in this environment.

The attached patch fixes this to use the eager_load setting to decide if the paths should be added to eager_load.


Files

plugin_eager_load.patch (692 Bytes) plugin_eager_load.patch Marius BĂLTEANU, 2019-01-31 12:14

Related issues

Related to Redmine - Defect #26636: Rails 5: "Page not found" error when accessing a page of a plugin in production modeClosedJean-Philippe Lang

Actions
Related to Redmine - Defect #30753: Plugins auto_load and eager_load pathsClosedGo MAEDA

Actions
Actions

Also available in: Atom PDF