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

Commit e5a55365 by Sascha Depold

hasAndBelongsTo{Many|One}

1 parent c13ff3de
Showing with 2 additions and 2 deletions
...@@ -178,7 +178,7 @@ exports.SequelizeTable = function(Sequelize, sequelize, tableName, attributes, o ...@@ -178,7 +178,7 @@ exports.SequelizeTable = function(Sequelize, sequelize, tableName, attributes, o
} }
}, },
hasManyAndBelongsTo: function(assocName, _table, backAssocName) { hasAndBelongsToMany: function(assocName, _table, backAssocName) {
var assoc = table.hasMany(assocName, _table) var assoc = table.hasMany(assocName, _table)
_table.belongsTo(backAssocName || assocName, table, assoc) _table.belongsTo(backAssocName || assocName, table, assoc)
}, },
...@@ -193,7 +193,7 @@ exports.SequelizeTable = function(Sequelize, sequelize, tableName, attributes, o ...@@ -193,7 +193,7 @@ exports.SequelizeTable = function(Sequelize, sequelize, tableName, attributes, o
return association return association
}, },
hasOneAndBelongsTo: function(assocName, _table, backAssocName) { hasAndBelongsToOne: function(assocName, _table, backAssocName) {
var assoc = table.hasOne(assocName, _table) var assoc = table.hasOne(assocName, _table)
_table.belongsTo(backAssocName || assocName, table, assoc) _table.belongsTo(backAssocName || assocName, table, assoc)
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!