不要怂,就是干,撸起袖子干!

Commit 7d28d8e6 by Sascha Depold

added association type for has many associations

1 parent 1b5385ac
Showing with 2 additions and 0 deletions
......@@ -6,6 +6,7 @@ var HasManySingleLinked = require("./has-many-single-linked")
module.exports = (function() {
var HasMany = function(srcDAO, targetDAO, options) {
this.associationType = 'HasMany'
this.source = srcDAO
this.target = targetDAO
this.options = options
......@@ -53,6 +54,7 @@ module.exports = (function() {
combinedTableAttributes[this.foreignIdentifier] = {type:DataTypes.INTEGER, primaryKey: true}
this.connectorDAO = this.source.daoFactoryManager.sequelize.define(this.combinedName, combinedTableAttributes, this.options)
if(!this.isSelfAssociation) {
this.target.associations[this.associationAccessor].connectorDAO = this.connectorDAO
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!