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

Commit 16e66c8d by Mick Hansen

Undo bulkcreate stuff

1 parent f7904548
...@@ -787,13 +787,6 @@ module.exports = (function() { ...@@ -787,13 +787,6 @@ module.exports = (function() {
.error(function(err) { .error(function(err) {
emitter.emit('error', err) emitter.emit('error', err)
}).success(function(rows) { }).success(function(rows) {
rows.forEach(function (row, i) {
Object.keys(daos[i].__factory.primaryKeys).concat('id').forEach(function (primarKey) {
if (row.hasOwnProperty(primarKey)) {
daos[i].setDataValue(primarKey, row[primarKey])
}
})
})
done() done()
}) })
} }
......
...@@ -89,7 +89,7 @@ module.exports = (function() { ...@@ -89,7 +89,7 @@ module.exports = (function() {
} }
var onSuccess = function(results, metaData) { var onSuccess = function(results, metaData) {
var result = this.callee var result = this.callee || results
// add the inserted row id to the instance // add the inserted row id to the instance
if (this.send('isInsertQuery', results, metaData)) { if (this.send('isInsertQuery', results, metaData)) {
......
...@@ -894,20 +894,6 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () { ...@@ -894,20 +894,6 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
}) })
}) })
it('should return instances with primary key values (autoincremented)', function (done) {
var Worker = this.sequelize.define('Worker', {})
Worker.sync().done(function(err) {
Worker.bulkCreate([{}, {}]).done(function (err, workers) {
expect(err).not.to.be.ok
expect(workers).to.be.ok
workers.forEach(function (worker) {
expect(worker.id).to.be.ok
})
done()
})
})
})
describe('enums', function() { describe('enums', function() {
it('correctly restores enum values', function(done) { it('correctly restores enum values', function(done) {
var self = this var self = this
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!