title: Handling namespace models (classes) in namespace
body: <p>I am using Ruby on Rails 3 and I would like to handle models (classes) namespaces within namespaces. That is, if I have a namespace named <em>NS1</em> and a "sub-namespace" of that namespace named <em>NS2</em>, I would like to handle models (classes) in <em>NS2</em>.</p>
  
  <p>If I run a <em>scaffold</em> </p>
  
  <pre><code>rails generate scaffold ns1/ns2/Article id:integer title:string
  </code></pre>
  
  <p>it will generate following model files:</p>
  
  <pre><code>models/ns1/ns2/article.rb file
  models/ns1/articles.rb
  </code></pre>
  
  <p>The <code>models/ns1/articles.rb</code> contains:</p>
  
  <pre><code>module Ns1::Articles
    def self.table_name_prefix
      'ns1_articles_'
    end
  end
  </code></pre>
  
  <p>What is the <code>models/ns1/articles.rb</code> file? How and why can I use that? Have you advices about using that?</p>
  
  <p><em>And, in general, what is "the best" way to handle "composed" classes in namespaces using Ruby on Rails?</em></p>