Issue #5621 has been updated by Thomas Sawyer.


@Yehuda
 
> At various times, I have tried to have Rails' internal structure operate by
> setting up autoloads ahead of time and letting Ruby do the rest.
> Unfortunately, in this case, we would have to explicitly define Admin, but
> we have no way to know whether Admin is a module or class. If we define it
> as a module, for instance, and user.rb looks like this:
> 
> class Admin
>   class User < ActiveRecord::Base
>     กฤ
>   end
> end
>
> we get: "Admin is not a class". As a result, cannot set everything up ahead
> of time and have to let the first file that is autoloaded define the
> intermediate namespaces.

This is one of the reasons why I know it would better if the distinction between class and module should be dropped. If you think about it the distinction is simply a idealized construct. The reality of the thing lies in it's usage. It's the same idea behind duck typing.

> While we're on the topic, http://redmine.ruby-lang.org/issues/2740 is
> probably the major remaining issue with Rails' autoload solution. To
> summarize:
 
There is one other that has been a pain for me: there is no way to override the require mechanism used by autoload as it does not use the Kernel method(s).

----------------------------------------
Backport #5621: Please backport thread-safe autoloading patch
http://redmine.ruby-lang.org/issues/5621

Author: Mike Perham
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 


This is critical to using Rails in thread-safe mode.  JRuby is supposed to have it in the next release, 1.7.

http://redmine.ruby-lang.org/issues/921

Waiting another 12-18 months for 1.9.4 to come out would really suck.


-- 
http://redmine.ruby-lang.org