It turns out that this line in config / applications.rb was the problem:
config.autoload_paths += Dir[Rails.root.join('app', 'models', '{**}')]
Rails is confused with explicitly installed startup; instead of looking under models / by placing names accordingly, he looked at the first startup file, which he (by mistake, models /bar/foo.rb), and found (true) that he could not determine Foo (he defines Bar :: Foo).
Thus, it is obvious that Rails 3 already knows how to search in models / sub-frames for models with names.
Thanks to Antiarc on freenode #RubyOnRails to help figure this out.
source share