title: How to prevent ActiveRecord to put the namespace of a model in the colum 'type' with Polymorphism
body: <p>I have a ruby app that uses ActiveRecord. I have the following models</p>
  
  <pre><code>module ExchangeManager
    module Resources
      class Composition &lt; ActiveRecord::Base
        belongs_to :chain
        belongs_to :link, :polymorphic =&gt; true, :primary_key =&gt; :id
      end
  
      class Chain &lt; ActiveRecord::Base
        has_many :compositions
      end
    end
  end
  </code></pre>
  
  <p>with the following migration</p>
  
  <pre><code>create_table :compositions do |t|
    t.references :link, :polymorphic =&gt; true
  end
  
  create_table :chains do |t|
    t.string :name, :null =&gt; false
  end
  </code></pre>
  
  <p>When I create a new chain with 2 associated compositions, the SQL table 'compositions' contains :</p>
  
  <p>id | link_id | link_type</p>
  
  <p>1  | 1       | ExchangeManager::Resources::Chain</p>
  
  <p>2  | 1       | ExchangeManager::Resources::Chain</p>
  
  <p>Instead of having the full namespace in the link_type column, I would like ActiveRecord to save only the short Class Name, ie 'Chain' instead of 'ExchangeManager::Resources::Chain'.</p>
  
  <p>Why ? Because I am using the same DB in an another Rails app, and I would like to be able to manipulates the same models in that project without namespaces.</p>