title: Product.belongsTo called with something that's not a subclass of Sequelize.Model
body: <p>i started to use the models/index file that squeli-cli generate   and now this is generateing me a error in the asociations</p>
  <p>my model product  my product can belog to many categories:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const { Model } = require('sequelize');
  
  module.exports = (sequelize, DataTypes) =&gt; {
    class Product extends Model {
      static associate(models) {
        Product.belongsTo(models.ProductType,{as:'family',foreignKey:'product_family'});
      }                                   
    };
  
    Product.init({
  
      id:{
        allowNull: false,
        autoIncrement: true,
        primaryKey: true,
        type: DataTypes.INTEGER
      },
      name: {
        type: DataTypes.STRING,
        allowNull: false,
        validate:{
            isAlphanumeric: true
        }
      },
      price:{
        type: DataTypes.FLOAT,
        allowNull: false,
        validate:{
          len: [0.1,10_000],
          isEven(value) {
            if (value &lt;= 0.1) {
              throw new Error('price must be 0.2$ or higher');
            }
          }
        }
      },
      product_code:{
        type: DataTypes.STRING,
        unique:true,
        allowNull: false,
        validate:{
          isAlphanumeric: true,
        }
      },
      product_quantity:{
        type: DataTypes.INTEGER,
        allowNull: false,
        validate:{
            isNumeric: true,
            len: [1,1_000_000_000],
            isEven(value) {
              if (value &lt;= 0) {
                throw new Error('quantity must be 1 or higher');
              }
            }
        }
      },
      notification: {
        type: DataTypes.BOOLEAN,
        // allowNull defaults to true
      },
    }, {sequelize,modelName: 'Product',});
  
    return Product;
  };</code></pre>
  </div>
  </div>
  </p>
  <p>my product types model  this model havemany products:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>'use strict';
  const { Model } = require('sequelize');
  
  module.exports = (sequelize, DataTypes) =&gt; {
    class ProductType extends Model {
      static associate(models) {
        ProductType.hasMany(models.Product, {as:'ProductType', foreignKey:'product_family'});
      }
    };
  
    ProductType.init({
  
      id:{
        allowNull: false,
        autoIncrement: true,
        primaryKey: true,
        type: DataTypes.INTEGER
      },
      name: {
        type: DataTypes.STRING,
        allowNull: false,
        validate:{
            isAlphanumeric: true
        }
      },
    }, { sequelize,modelName: 'product_Type',});
  
    return ProductType;
  };</code></pre>
  </div>
  </div>
  </p>
  <p>and this is my  models/index</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>'use strict';
  
  const fs = require('fs');
  const path = require('path');
  const Sequelize = require('sequelize');
  const basename = path.basename(__filename);
  
  //config 
  const config = require('../config/database');
  
  //declaracion de objeto db
  const db = {};
  
  //inicializar la conexion
  const sequelize = new Sequelize(config.database,config.username,config.password,{
    host: config.host,
    dialect: config.dialect,
  });
  
  
  fs
    .readdirSync(__dirname)
    .filter(file =&gt; {
      return (file.indexOf('.') !== 0) &amp;&amp; (file !== basename) &amp;&amp; (file.slice(-3) === '.js');
    })
    .forEach(file =&gt; {
      const model = require(path.join(__dirname, file))(sequelize, Sequelize.DataTypes);
      
      //cada modelo del directorio lo vinculamos a db
      db[model.name] = model;
    });
  
    //realizar las asociaciones  de los modelos 
  Object.keys(db).forEach(modelName =&gt; {
    if (db[modelName].associate) {
      db[modelName].associate(db);
    }
  });
  
  db.sequelize = sequelize;
  db.Sequelize = Sequelize;
  
  module.exports = db;</code></pre>
  </div>
  </div>
  </p>
  <p>and y got this error
  <a href="https://i.stack.imgur.com/4mdZP.png" rel="nofollow noreferrer">error image</a></p>
  <p>how can i solve this</p>