title: FindAll include more tables on sequelize query
body: <p>I have the following query on my server controller where I bring all the data from al associate tables for my course:</p>
  
  <pre><code>db.Course.findAll({
    include: [
      // {model:db.Room, attributes:['id','DisplayLabel']},
      // {model:db.Period, attributes:['id','DisplayName']},
      { model: db.Subject, attributes: ["id", "Name"] },
      // {model:db.Schedule, attributes:['id','Day','StartHour','EndHour']},
      { model: db.Person, where: { id: db.Course.PersonId } }
    ]
  });
  </code></pre>
  
  <p>The Course Model association is like this:</p>
  
  <pre><code>Course.hasMany(models.Schedule);
  
  Course.belongsTo(models.Period);
  Course.belongsTo(models.Room);
  Course.belongsTo(models.Subject);
  Course.belongsTo(models.School);
  Course.belongsTo(models.Person);
  </code></pre>
  
  <p>The Problem is that I can't get the "Person" data cause sql log shows that the joins goes all the way through other table associate with the Person Model:</p>
  
  <pre><code>verbose: Executing (default): SELECT `Course`.`id`, `Course`.`Scholarship`, `Course`.`Level`, `Course`.`CourseType`, `Course`.`RecordStatus`, `Course`.`DeletedAt`, `Course`.`createdAt`, `Course`.`updatedAt`, `Course`.`PeriodId`, `Course`.`RoomId`, `Course`.`SubjectId`, `Course`.`SchoolId`, `Course`.`PersonId`, `Course`.`CreatedById`, `Course`.`UpdateById`, `Course`.`DeleteById`, `Subject`.`id` AS `Subject.id`, `Subject`.`Name` AS `Subject.Name`, `People`.`id` AS `People.id`, `People`.`RFC` AS `People.RFC`, `People`.`FirstName` AS `People.FirstName`, `People`.`LastName` AS `People.LastName`, `People`.`LastName2` AS `People.LastName2`, `People`.`Phone` AS `People.Phone`, `People`.`Cellphone` AS `People.Cellphone`, `People`.`Email` AS `People.Email`, `People`.`Birthday` AS `People.Birthday`, `People`.`RecordStatus` AS `People.RecordStatus`, `People`.`DeletedAt` AS `People.DeletedAt`, `People`.`createdAt` AS `People.createdAt`, `People`.`updatedAt` AS `People.updatedAt`, `People`.`RoleId` AS `People.RoleId`, `People`.`SchoolId` AS `People.SchoolId`, `People`.`TutorId` AS `People.TutorId`, `People`.`CreatedById` AS `People.CreatedById`, `People`.`UpdateById` AS `People.UpdateById`, `People`.`DeleteById` AS `People.DeleteById`, `People.Task`.`Title` AS `People.Task.Title`, `People.Task`.`Content` AS `People.Task.Content`, `People.Task`.`Grade` AS `People.Task.Grade`, `People.Task`.`OtherDetails` AS `People.Task.OtherDetails`, `People.Task`.`TaskType` AS `People.Task.TaskType`, `People.Task`.`RecordStatus` AS `People.Task.RecordStatus`, `People.Task`.`DeletedAt` AS `People.Task.DeletedAt`, `People.Task`.`createdAt` AS `People.Task.createdAt`, `People.Task`.`updatedAt` AS `People.Task.updatedAt`, `People.Task`.`KardexId` AS `People.Task.KardexId`, `People.Task`.`PersonId` AS `People.Task.PersonId`, `People.Task`.`CourseId` AS `People.Task.CourseId`, `People.Task`.`CreatedById` AS `People.Task.CreatedById`, `People.Task`.`UpdateById` AS `People.Task.UpdateById`, `People.Task`.`DeleteById` AS `People.Task.DeleteById` FROM `Courses` AS `Course` LEFT OUTER JOIN `Subjects` AS `Subject` ON `Course`.`SubjectId` = `Subject`.`id` INNER JOIN (`Tasks` AS `People.Task` INNER JOIN `People` AS `People` ON `People`.`id` = `People.Task`.`PersonId`) ON `Course`.`id` = `People.Task`.`CourseId` AND `People`.`id` = NULL;
  </code></pre>
  
  <p>Like you can see it brings the columns from the Task model, this is a table that origins from a m:n relation between Course and People</p>
  
  <pre><code>associate: function(models){
    models.Person.belongsToMany(models.Course, {through : Task});
    models.Course.belongsToMany(models.Person, {through : Task});
  }
  </code></pre>
  
  <p>Also if I delete the table from the database just for debug purpose it does the same with another m:n relation. How do I exclude this from the join for just get data?</p>
  
  <p>The Model Person, is you're wondering it saves all the different user: Student, Teacher, Father and it has a foreign key of Role Model that have this RoleTypes. That's why I have on Course Model the PersonId key that is in this case the Teacher and in the Task model for example, the PersonId refers to student user.</p>