This project is archived and is in readonly mode.
defaults for eager_load_paths and load_once_paths overwrite each other (typo?)
Reported by Kim Altintop | April 9th, 2010 @ 12:28 PM | in 3.0.2
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
Comments and changes to this ticket
-
Repository April 10th, 2010 @ 12:30 PM
- State changed from new to resolved
(from [b22d0914acf04f4440db7ed281fb821150524614]) Fix a typo in load_once_paths [#4357 state:resolved] (ht: Kim Altintop) http://github.com/rails/rails/commit/b22d0914acf04f4440db7ed281fb82...
-
José Valim April 10th, 2010 @ 12:31 PM
- Assigned user set to José Valim
- Milestone cleared.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Referenced by
- 4357 defaults for eager_load_paths and load_once_paths overwrite each other (typo?) (from [b22d0914acf04f4440db7ed281fb821150524614]) Fix a t...