title: How to do a LEFT JOIN in Sequelize with more than one predicate in the ON clause?
body: <p>This is my very simple Sequelize model relation:</p>
  
  <pre><code>    models["Post"]
          .hasMany(models["PostLike"])
      models["PostLike"]
          .belongsTo(models["Post"])
  </code></pre>
  
  <p>and this is my Sequelize.findAll query (written in CoffeeScript):</p>
  
  <pre><code>Post.findAll
              include : [ PostLike ]
              where : where
              offset : start
              limit : limit
              order : order
  .success (posts) =&gt;
       ......
  .failure (error) =&gt;
       ......
  </code></pre>
  
  <p>As you can see I include the PostLike model and Sequelize produces the correct LEFT JOIN:</p>
  
  <pre><code>...FROM "posts" LEFT JOIN "post_likes" AS "post_likes" 
      ON "posts"."id" = "posts_likes"."post_id" ...
  </code></pre>
  
  <p>However, I would like to get Sequelize to extend the ON predicates with my custom criteria:</p>
  
  <pre><code>... ON "posts"."id" = "posts_likes"."post_id" AND posts_likes.author_id = 123
  </code></pre>
  
  <p>It might be something very easy to do, I just could not find it in the docs.</p>
  
  <p>Thanks</p>