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

Commit 7e98cc9c by Sascha Depold

many-to-many association data storage should work now as well

1 parent bd1279d3
Showing with 3 additions and 3 deletions
......@@ -68,7 +68,7 @@ module.exports.Factory = function(Sequelize, sequelize) {
})
table2.findAll({where: "id IN (" + ids.join(",") + ")"}, function(objects) {
// self.fetchedAssociations[assocName] =
self.setAssociationDataFor(assocName, objects)
if(_callback) _callback(objects)
})
} else {
......@@ -76,7 +76,7 @@ module.exports.Factory = function(Sequelize, sequelize) {
}
})
} else {
if(_callback) _callback(this.fetchedAssociations[assocName])
if(_callback) _callback(this.getAssociationDataFor(assocName))
}
}
},
......@@ -87,7 +87,7 @@ module.exports.Factory = function(Sequelize, sequelize) {
objectIds = Sequelize.Helper.Array.map(objects, function(obj) { return obj.id })
var getAssociatedObjects = function(callback) {
self[Sequelize.Helper.SQL.addPrefix('get', assocName)](callback)
self[Sequelize.Helper.SQL.addPrefix('get', assocName)]({refetchAssociations: true}, callback)
}
var deleteObsoleteAssociations = function(currentAssociations, callback) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!