Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

defaults for eager_load_paths and load_once_paths overwrite each other (typo?)

#4357

Defaults for eager_load_paths and load_once_paths are assigned to the same instance variable of Rails::Engine::Configuration (@eager_load_paths), which may cause classes to be reloaded in dev mode even if their paths where explicitly configured as load_once_paths. This is an issue especially with JRuby-based Rails applications which make use of Java libraries and may rely on singletons / must avoid attempts to reload jar files.

The following simple patch fixes the problem:

diff --git a/railties/lib/rails/engine/configuration.rb b/railties/lib/rails/engine/configuration.rb
index 28e7ef9..c5411a0 100644
--- a/railties/lib/rails/engine/configuration.rb
+++ b/railties/lib/rails/engine/configuration.rb
@@ -43,7 +43,7 @@ module Rails
       end

       def load_once_paths
-        @eager_load_paths ||= paths.load_once
+        @load_once_paths ||= paths.load_once
       end

       def load_paths

Reported by Kim Altintop · April 9th, 2010 @ 12:28 PM

State: resolved
Milestone: 3.0.2
Assigned to: José Valim José Valim
Importance: none