Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Autoloading models from external folder fails on Rails 3.1, 3.2 #5007
What I'm basically doing is sharing some models across multiple projects. I have a base project where all models are defined and some other projects that requires thous models, as all of them use the same data.
By that said, what I used to do is define a config.autoload_paths pointing to the other projects model folder:
With Rails 3.0 it works perfectly fine, however with Rails 3.1, 3.2, I get uninitialized constnat to every model name, for example:
@pixeltrix I don't know if I'm doing it wrong but, using File.expand_path gave me:
Here is the snipet:
The engine may became an alternative, but I still looking for a way to make Rails look for the shared models without using it.
Okay I can confirm this works for me in 3.2.3 if you can provide any further information on how it's not working for you then I'll take another look at it. You don't need the