sequelize/sequelize — pull request #761 by sdepold (2013-07-11 18:54:03+00:00)
Title: Allow reference by DaoFactory in foreign key definition

This PR extends @optilude great work and makes it possible to pass a DaoFactory to the references option of the foreign key definition:

this.Author = this.sequelize.define('author', { firstName: Sequelize.STRING })
this.Post = this.sequelize.define('post', {
title: Sequelize.STRING,
authorId: {
type: Sequelize.INTEGER,
references: this.Author,
referencesKey: "id"
}
})