title: Sequelize Association throws an error in Create
body: <p>I'm trying to do a simple association with sequelize in my NodeJS API, the idea is simple, I  want to create a person and his type in the same moment. I try to follow the docs, but, when the create function is called Sequelize throws the error<br>
  <br/>
  <strong>"TypeError: Cannot read property &#39;getTableName&#39; of undefined"</strong>
  <br/></p>
  
  <p>Bellow is the code used:</p>
  
  <p>Models <br/>
  <br/>
  Person.js</p>
  
  <pre><code>import Sequelize from 'sequelize';
  
  export default (sequelize) =&gt; {
    const Person = sequelize.define('person', {
      email: { type: Sequelize.STRING },
      nickname: { type: Sequelize.STRING(60) },
      fullname: { type: Sequelize.STRING(60) },
      observation: { type: Sequelize.TEXT },
    }, { underscored: true, freezeTableName: true });
  
    Person.associate = (models) =&gt; {
      Person.hasOne(models.PersonType, {
        foreignKey: 'person_id',
      });
    };
  
    return Person;
  };
  </code></pre>
  
  <p>PersonType.js</p>
  
  <pre><code>import Sequelize from 'sequelize';
  
  export default (sequelize, DataTypes) =&gt; {
    const PersonType = sequelize.define('person_type', {
      type: { type: Sequelize.STRING(14), unique: true },
    }, { underscored: true, freezeTableName: true });
  
    PersonType.associate = (models) =&gt; {
      PersonType.belongsTo(models.Person, {
        foreignKey: 'person_id',
      });
    };
  
    return PersonType;
  };
  </code></pre>
  
  <p>index.js</p>
  
  <pre><code>import Sequelize from 'sequelize';
  import console from 'console';
  
  const database = process.env.DB_URL;
  
  const sequelize = new Sequelize(database, {
    dialect: 'postgres',
    underscored: true,
  });
  
  const models = {
     Person: sequelize.import('./person'),
     PersonType: sequelize.import('./personType'),
  };
  
  Object.keys(models).forEach((modelName) =&gt; {
    if ('associate' in models[modelName]) {
      models[modelName].associate(models);
    }
  });
  
  models.sequelize = sequelize;
  models.Sequelize = Sequelize;
  
  export default models;
  </code></pre>
  
  <p>The file where I try to execute the operation:</p>
  
  <pre><code>import models from '../models';
  
  export default class PersonOperations {
    constructor(db) {
      this.db = db; // db here is the sequelize model of Person
    }
  
    create(person) {
      return this.db.create({
        email: person.email,
        nickname: person.nickname,
        observation: person.observation,
        personType: {
          type: person.personType.type,
        },
      }, {
        include: [{
          model: models.PersonType,
          include: [person.personType],
        }],
      });
    }
  </code></pre>
  
  <p>The error:</p>
  
  <pre><code>TypeError: Cannot read property 'getTableName' of undefined
      at Function._validateIncludedElement (/home/~/node_modules/sequelize/lib/model.js:465:30)
      at options.include.options.include.map.include (/home/~/node_modules/sequelize/lib/model.js:395:37)
      at Array.map (&lt;anonymous&gt;)
      at Function._validateIncludedElements (/home/~/node_modules/sequelize/lib/model.js:390:39)
  </code></pre>
  
  <p>I have already tried a lot of different things that I have found, but none of them helped me.</p>
  
  <ul>
  <li>I am using freezeTableName, I have already tried to remove that, drop the database and create again, but the problem still persists.</li>
  </ul>