sequelize/sequelize — pull request #913 by janmeier (2013-09-17 13:42:23+00:00)
Title: Allow include when the same table is referenced multiple times using hasMany

This bugs happens because a hasMany assocation is saved under its combined table name in DAO.associations, even if an alias is specified. This means that only the most recent association is saved. Example:

```js
Group.belongsTo(User, { foreignKey: 'primaryGroupId', as: 'primaryUsers' })
Group.belongsTo(User, { foreignKey: 'secondaryGroupId', as: 'secondaryUsers' })
```

Before, the association would be saved under Group.associations.GroupsUsers for both calls, so the second call would overwrite the primaryUsers association, making this impossible:
```js
Group.find({
include: [
{ model: User, as: 'primaryUsers' },
{ model: User, as: 'secondaryUsers' }
]
})
```
The call would fail telling you that the assocation primaryUsers does not exist

This PR saves the association under its alias if one is defined, in the same way that hasOne and belongsTo does. The bug only affects hasMany, but I have added corresponding tests for hasOne and belongsTo as well to make sure that no-one messes that up in the future