sdepold/sequelize — pull request #456 by jfyles (2013-02-21 18:50:31+00:00)
Title: Modify how the ForeignKey attribute is applied to a join on a HasOne association

Trying this again for a second time to try to get travis to do the build. If it doesn't work does someone mind dissecting the test with me to see if it is the test or this code that is incorrect? I can't think of a scenario when we wouldn't want the foreign key attribute to be applied to the association's table

Prior to this change, the following scenario:
```javascript
var CategorizationQuestion = client.define('campaign_categorization_questions', {
id: Sequelize.INTEGER,
description: Sequelize.TEXT
});

var CategorizationOption = client.define('campaign_categorization_options', {
id: Sequelize.INTEGER,
question_id: Sequelize.INTEGER,
description: Sequelize.TEXT
});

CategorizationOption.hasOne(CategorizationQuestion, {as: 'question', foreignKey: 'question_id', useJunctionTable: false });
CategorizationQuestion.hasMany(CategorizationOption, {as: 'options', foreignKey: 'question_id', useJunctionTable: false });
```

Would produce a non-working query when trying to join the tables, such as in the following code:

```javascript
CategorizationQuestion.findAll({include: ['options']}) ...
```

because it would try to join on the non-existent "question_id" column on CategorizationQuestion

Cheers!

Justin