This project is archived and is in readonly mode.
autoload + config.threadsafe! broken?
-
mark
If anyone is interested, here's the solution (in initializer) I use for now:
Dir.chdir "#{Rails.root}/lib/" do
Dir["**/*.rb"].each do |lib| basename = lib.match(/(.*)\.rb$/)[1].classify parts = basename.split("::") if parts.size > 1 eval <<-EVAL module ::#{parts[0..-2].join("::")} autoload :#{parts[-1]}, "#{File.expand_path(lib)}" end EVAL else autoload parts[0].classify.to_sym, File.expand_path(lib) end endend
Ideas, anyone?
Checked this vs ruby 1.9.2-head.
-
Jacek Becela
Having the same problem on 1.8.7 and regular models located in app/models.
-
Jacek Becela
Probably not a bug, following is the documentation for #threadsafe!
# Enable threaded mode. Allows concurrent requests to controller actions and # multiple database connections. Also disables automatic dependency loading # after boot, and disables reloading code on every request, as these are # fundamentally incompatible with thread safety. -
mark
Seems like that doc isn't for long. Probably the issue could be documented and closed.
The temporary solution I use still seems to work, though. -
mark
isn't for long "hasn't been there for a long time" disambiguation fix
-
mark
isn't for long
"hasn't been there for a long time" - disambiguation fix. Sry for flood, having no edit option hurts.
-
Rohit Arondekar
- Importance changed from to Low
Mark, since documentation for #threadsafe! already mentions this, can this ticket be closed?
-
mark
Yeah, seems it won't fix.
-
Rohit Arondekar
- State changed from new to invalid