rails/rails — Issue #5007: Autoloading models from external folder fails on Rails 3.1, 3.2
Author: brodock
Created: 2012-02-11 21:17:47+00:00
State: open

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 some of thous, because 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:

config.autoload_paths += %W(#{config.root}/../base_project/app/models)

With Rails 3.0 it works perfectly fine, with Rails 3.1, 3.2, I get uninitialized constat to every model name, for example:

NameError (uninitialized constant ApplicationController::User):
app/controllers/application_controller.rb:11:in `current_user'