title: .hasMany called with something that's not a subclass of Sequelize.Model
body: <p>I'm trying to refer a foreign key between 2 models.
  but I'm getting this error:</p>
  
  <p><code>throw new Error(this.name + '.hasMany called with something that\'s not a subclass of Sequelize.Model');</code>
        ^</p>
  
  <p>Error: user_relation.hasMany called with something that's not a subclass of Sequelize.Model</p>
  
  <p><strong>squelize.js</strong></p>
  
  <pre><code>const Sequelize = require('sequelize');
  const config = require('./default.config')
  const sequelize = new Sequelize(config.database, config.user, config.password, {
    host: config.host,
    port: config.port,
    dialect: 'mysql',
    timezone: config.timezone,//东八区
    pool: {
      max: 5,
      min: 0,
      acquire: 30000,
      idle: 10000
    }
  });
  
  sequelize
    .sync()
    .then(err =&gt; {
      console.log('Connection has been established successfully.');
    })
    .catch(err =&gt; {
      console.error('Unable to connect to the database:', err);
    });
  
  module.exports = sequelize;
  </code></pre>
  
  <p><strong>User model</strong></p>
  
  <p>const sequelize = require('sequelize');
      const Model = require('../../config/squelize');</p>
  
  <pre><code>const Admin = Model.define('admin', {
    username : {type : sequelize.STRING, allowNull : false},//用户名
    password : {type : sequelize.STRING, allowNull : false},//密码
    details : {type : sequelize.STRING, allowNull : true},//简介
    head_thumb : {type : sequelize.STRING, allowNull : true},//头像
    gender : {type : sequelize.STRING, allowNull : true},//性别
    nickname : {type : sequelize.STRING, allowNull : true},//昵称
    userid : {type : sequelize.INTEGER, autoIncrement : true, primaryKey : true}//用户userid
  }, {
    freezeTableName:true
  })
  
  module.exports = Admin;
  </code></pre>
  
  <p><strong>admin_relation.js</strong></p>
  
  <pre><code>var Sequelize = require('sequelize');
  const Model = require('../../config/squelize');
  const Admin = require('./admin.model')
  
  var user_relation = Model.define('user_relation', {
      id : {type : Sequelize.INTEGER, autoIncrement : true, primaryKey : true},
      userid : {type : Sequelize.STRING, allowNull : false},//用户id
      frendid : {type : Sequelize.STRING, allowNull : false}//朋友id
  },{
      timestamps:false,
      freezeTableName:true,
  });
  user_relation.hasMany(Admin,{as:'admin',foreignKey:'userid'})
  
  module.exports = user_relation;
  </code></pre>
  
  <p>Does someone have already see an error that look like that ? I search for few days without any issue, if someone could help I'll really appreciate,</p>
  
  <p>thank !</p>