sferik/rails_admin — Issue #770: Namespace expected when none is necessary
Author: billmccord
Created: 2011-10-11 15:28:22+00:00
State: open

I have put many of my models into sub-folders and modified my Application < Rails::Application to auto-load my models with the following statement:
config.autoload_paths += Dir["#{config.root}/app/models/**/"]

Everything seems to work fine except for rails_admin which expects any models in sub-folders to have a namespace attached per the sub-folders name. For example if I have:

/app/models/subfolder/class_a.rb

rails_admin gives me the following error:
Error while loading 'Subfolder::ClassA': Expected [RAILS_PATH]/app/models/subfolder/ClassA.rb to define Subfolder::ClassA

This didn't happen in my previous version of rails_admin when I was using rails 3.1.0, but it happens in the latest version using rails 3.1.1.