title: Sequelize - ForeignKey relationship - problem with alias
body: <p>I have two tables. One is skills, another is ratings. My problem is specific to ratings:
  The model of ratings is:</p>
  
  <pre><code>var sequelize = require('../sequelizeConfig');
  var Sequelize = require('sequelize');
  
  var Ratings=sequelize.define('ratings',{
    ratingID:{
       type:Sequelize.BIGINT,
       field:'rating_id',
       primaryKey:true
    },
     empID:{
         type: Sequelize.STRING,
         field:'emp_id'
      },
     skillID:{
         type:Sequelize.STRING,
         field:'skill_id',
         references: {
          model: 'skills',
          key: 'skill_id'
         }
      },
     rating:{
      type: Sequelize.BIGINT ,
    field:'rating'  
  }
  },{
      tableName:'ratings',
      freezeTableName: true 
    })
  
  module.exports=Ratings;
  </code></pre>
  
  <p>In controller, i have below relation. I am unsure if use of hasOne is right. With only 'belongsTo' to state foreignkey relationship, i only got ratings is not associated to skills. Basically  skill_id in ratings table has reference to skill_id in skills table.</p>
  
  <pre><code>var skillsets = require('../../models/skillsets');
  var ratings = require('../../models/ratings');
  skillsets.hasOne(ratings,{foreignKey:'skillID',sourceKey:'skillsetID'});
  ratings.belongsTo(skillsets,{foreignKey:'skillID',targetKey:'skillsetID'});
  </code></pre>
  
  <p>I tried to query as below:</p>
  
  <pre><code>skillsets.findAll({
              where:{
                  roleID: role
              },
              include:[{
                  model:ratings,
                  where:{
                      emp_id: empID
                  },
                  attributes:['rating'],
                  required:false
              }]
          })
  </code></pre>
  
  <p>Everything seem fine but this hasOne does something fishy. 
  It generates query as:</p>
  
  <pre><code>SELECT "skills"."skill_id" AS "skillsetID", "skills"."role_id" AS "roleID", "skills"."field", "skills"."skill_name" AS "skillName", "rating"."rating_id" AS "rating.ratingID", "rating"."rating" AS "rating.rating" FROM "skills" AS "skills" LEFT OUTER JOIN "ratings" AS "rating" ON "skills"."skill_id" = "rating"."skill_id" AND "rating"."emp_id" = '12344' WHERE "skills"."role_id" = 'developer';
  </code></pre>
  
  <p>Due to "rating"."rating" AS "rating.rating"  , result comes as below:</p>
  
  <pre><code>[
      {
          "skillsetID": "Angular",
          "roleID": "developer",
          "field": "Frontend",
          "skillName": "Angular",
          "rating": 
              {
                  "rating": "4"
              }
  
  }]
  </code></pre>
  
  <p>What i expect is just like:</p>
  
  <pre><code>  [
          {
              "skillsetID": "Angular",
              "roleID": "developer",
              "field": "Frontend",
              "skillName": "Angular",
              "rating":4
      }]
  </code></pre>
  
  <p>Could you please favour?</p>