title: Rails : Has_Many Through polymophic Could not find the association in model
body: <p>I'm in front of a little problem, I try to have a polymophic has many through association :</p>
  
  <h1>post.rb</h1>
  
  <blockquote>
    <p>has_many :categories, as: :categorizable, through: :categorizations</p>
  </blockquote>
  
  <h1>category.rb</h1>
  
  <blockquote>
    <p>has_many :categorizables, through: :categorizations, dependent: :destroy</p>
  </blockquote>
  
  <h1>event.rb</h1>
  
  <blockquote>
    <p>has_many :categories, as: :categorizable, through: :categorizations</p>
  </blockquote>
  
  <h1>categorization.rb</h1>
  
  <blockquote>
    <p>belongs_to :categorizable, :polymorphic => true</p>
    
    <p>belongs_to :category</p>
  </blockquote>
  
  <h1>My migration :</h1>
  
  <blockquote>
    <p>def change</p>
  
  <pre><code>create_table :categories do |t|
    t.string :name
  
    t.timestamps
  end
  
  create_table :categorizations do |t|
    t.references :category
  
    t.integer :categorizable_id, :polymorphic =&gt; true
    t.string :categorizable_type, :polymorphic =&gt; true
  
    t.datetime :created_at
  end
  
  add_index :categorizations, :category_id   
  </code></pre>
    
    <p>end</p>
  </blockquote>
  
  <h1>the problem :</h1>
  
  <p>I got this error :</p>
  
  <blockquote>
    <p>Could not find the association :categorizations in model Post</p>
  </blockquote>
  
  <p>Or when I try in category</p>
  
  <blockquote>
    <p>Could not find the association :categorizations in model Category</p>
  </blockquote>
  
  <p>Does anyone know where is the problem?</p>