From: Elias Orozco Date: 2009-04-05T03:24:04+09:00 Subject: Re: Loading classes in order Robert Klemme wrote: > On 04.04.2009 00:31, Elias Orozco wrote: >> I think I'll have to go that way. > > I do not understand why you seem to be so reluctant to declare > dependencies properly via "require". Can you explain that? The time it > takes to discuss this and search Rails source code is almost certainly > more than what it takes to simply use "require" the way it was intended > to. > > > I wonder if that is how rails does to >> load classes when the server is initialize. I wandered around the >> initializer file but couldn't get how it was done. Thanks again, > > Are you sure you can throw a number of files with dependencies into a > folder and Rails will somehow figure the load order? > > Regards > > robert > > > PS: Please do not top post. The app I'm working on is an online editor where a user create classes that connect to back-ends and fetch data. The users can create classes and have them all in their personal folder (security issues with this type of apps are high, I'm working on that too). So basically when the user wants to initialize an object of a class that depends on another one I don't want uninitialized constant errors. I could make require as it is the way is intended to do as you say. But I have seen that when I put all those classes in the rails lib folder, for example, they're all loaded without problem when I initialize the server and I can make an instance object of any class without any error. I want something like that. Thanks, Elias -- Posted via http://www.ruby-forum.com/.