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

Commit 1c16980a by Mick Hansen

Merge branch 'master' into milestones/2.0.0

2 parents 272e0c56 c0b75438
......@@ -689,6 +689,12 @@ module.exports = (function() {
Utils.validateParameter(fieldsOrOptions, Object, { deprecated: Array, optional: true, index: 2, method: 'DAOFactory#bulkCreate' })
Utils.validateParameter(options, 'undefined', { deprecated: Object, optional: true, index: 3, method: 'DAOFactory#bulkCreate' })
if (!records.length) {
return new Utils.CustomEventEmitter(function(emitter) {
emitter.emit('success', [])
}).run();
}
options = Utils._.extend({
validate: false,
hooks: false
......
......@@ -884,6 +884,18 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
})
})
it('should allow blank arrays (return immediatly)', 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
expect(workers.length).to.equal(0)
done()
})
})
})
it('should allow blank creates (with timestamps: false)', function (done) {
var Worker = this.sequelize.define('Worker', {}, {timestamps: false})
Worker.sync().done(function(err) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!