title: Squelize: how to use junction table to create other associates?
body: <p>I have three basic tables A, B and C. A and B have many-to-many relation. So I use junction table of A_B. C has one-to-many relation to A_B. This is how they are defined when using sequelize.</p>
  
  <pre><code>A.associate = function(models) {
      A.belongsToMany(models.B, {
          through: 'A_B',
          as: 'Bs',
          foreignKey: 'a_id'
      });
  };
  </code></pre>
  
  <p>B is similar, then C.</p>
  
  <pre><code>C.associate = function(models) {
      C.hasMany(models.A_B, {
          as: 'ABs',
          foreignKey: 'c_id'
      });
  };
  </code></pre>
  
  <p>But when I run it, I get the following message.</p>
  
  <pre><code>Error: C.hasMany called with something that's not a subclass of Sequelize.Model
  </code></pre>
  
  <p>It looks like sequelize does not recognize A_B as valid. Any way to solve?</p>
  
  <p>Thanks.</p>