title: Rails 3 namespacing requires model to be defined twice?
body: <p>I'm pulling my hair out trying to understand namespacing in Rails 3.  I've tried following a few different tutorials, and the only way I can get my models to work is if I define my model in both the base directory and my namespace directory.  </p>
  
  <p>If I only define the model in the namespace directory it expects it to define both Model and Namespace::Model, as below:</p>
  
  <pre><code>LoadError (Expected .../app/models/plugins/chat.rb to define Chat):
  </code></pre>
  
  <p>or</p>
  
  <pre><code>LoadError (Expected .../app/models/plugins/chat.rb to define Plugins::Chat):
  </code></pre>
  
  <p>I'm sure I'm missing something obvious, but I could really use a pointer in the right direction.
  Here are the relevant excerpts.</p>
  
  <p>/models/plugins/chat.rb</p>
  
  <pre><code>class Plugins::Chat
    include ActiveModel::Validations
    include ActiveModel::Conversion
    extend ActiveModel::Naming
  ...
  end
  </code></pre>
  
  <p>/controllers/plugins/chats_controller.rb</p>
  
  <pre><code>class Plugins::ChatsController &lt; Plugins::ApplicationController
  load_and_authorize_resource
  ...  
  end
  </code></pre>
  
  <p>/config/routes.rb</p>
  
  <pre><code>namespace :plugins do 
    resources :chats
  end
  </code></pre>
  
  <p>/config/application.rb</p>
  
  <pre><code>config.autoload_paths += Dir["#{config.root}/app/models/**/"]
  </code></pre>
  
  <p><em><strong>Edit</em></strong>
  This is some kind of bad interaction with CanCan, the gem we're using for permissions. The line load_and_authorize_resource is somehow at fault.  Will keep digging... </p>