title: Single Table Inheritance in a rails model after namespace changes
body: <p>I have single table inheritance working on one of my models</p>
  
  <pre><code>module Mod
    class Car &lt; ActiveRecord::Base
    end
  
    class Ferrari &lt; Car
    end
  end
  </code></pre>
  
  <p>and it all works really well;</p>
  
  <pre><code>Mod::Car.all
  ==&gt; select * from cars
  Mod::Ferrari.all
  ==&gt; select * from cars where type = "Ferrari"
  </code></pre>
  
  <p>Not a problem. The requirement (because of DRB) is that we publish these models un-namespaced, so I created a global classes that inherit from the working ones;</p>
  
  <pre><code>class Car &lt; Mod::Car; end
  class Ferrari &lt; Mod::Ferrari; end
  </code></pre>
  
  <p>and this all works perfectly... except for the single table inheritance which is now going;</p>
  
  <pre><code>Ferrari.all
  ==&gt; select * from cars where type = "Ferrari"
  Car.all
  ==&gt; select * from cars where type = "Car" 
  </code></pre>
  
  <p>Which is coming back empty because "Car" is an abstract concept that we never create an instance of. It's not identifying "Car" as the root model for all the others any more! Why does this functionality change when I inherit? </p>
  
  <p>I'm guessing that this has something to do with the fact that rails is inferring things from the class structure and so on. What properties are available to me to reset the original behaviour after de-namespacing?</p>