title: unknown column in field list sequelize
body: <p>I'm trying to perform the following query using Sequelize:</p>
  
  <pre><code>db.Post.findAll({
        include: [
          {
            model: db.User,
            as: 'Boosters',
            where: {id: {[Op.in]: a_set_of_ids }}
          },
          {
            model: db.Assessment,
            as: 'PostAssessments',
            where: {UserId: {[Op.in]: another_set_of_ids}}
          }
        ],
        attributes: [[db.sequelize.fn('AVG', db.sequelize.col('Assessments.rating')), 'average']],
        where: {
          average: 1
        },
        group: ['id'],
        limit: 20
      })
  </code></pre>
  
  <p>But I run to this error: "ER_BAD_FIELD_ERROR". Unknown column 'Assessments.rating' in 'field list', although I do have table "Assessments" in the database and "rating" is a column in that table.</p>
  
  <p>My Post model looks like this:</p>
  
  <pre><code>const Post = sequelize.define('Post', {
  title: DataTypes.TEXT('long'),
  description: DataTypes.TEXT('long'),
  body: DataTypes.TEXT('long')
    }, {
    timestamps: false
      });
  
    Post.associate = function (models) {
      models.Post.belongsToMany(models.User, {as: 'Boosters', through: 'UserPostBoosts' });
      models.Post.hasMany(models.Assessment, {as: 'PostAssessments'});
    };
  </code></pre>
  
  <p>What am I doing wrong?</p>