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

Commit d01ce9b1 by Mick Hansen

hooks change changelog entry

1 parent df180435
Showing with 3 additions and 2 deletions
...@@ -24,6 +24,7 @@ Notice: All 1.7.x changes are present in 2.0.x aswell ...@@ -24,6 +24,7 @@ Notice: All 1.7.x changes are present in 2.0.x aswell
- `QueryInterface` no longer emits global events. This means you can no longer do things like `QueryInterface.on('showAllSchemas', function ... ` - `QueryInterface` no longer emits global events. This means you can no longer do things like `QueryInterface.on('showAllSchemas', function ... `
- `sequelize.showAllSchemas` now returns an array of schemas, instead of an array containinig an array of schemas - `sequelize.showAllSchemas` now returns an array of schemas, instead of an array containinig an array of schemas
- `sequelize.transaction()` now returns a promise rather than a instance of Sequelize.Transaction - `sequelize.transaction()` now returns a promise rather than a instance of Sequelize.Transaction
- `bulkCreate`, `bulkUpdate` and `bulkDestroy` (and aliases) now take both a `hooks` and an `individualHooks` option, `hooks` defines whether or not to run the main hooks, and `individualHooks` defines whether to run hooks for each instance affected.
# v2.0.0-dev11 # v2.0.0-dev11
### Caution: This release contains many changes and is highly experimental ### Caution: This release contains many changes and is highly experimental
......
...@@ -588,10 +588,10 @@ module.exports = (function() { ...@@ -588,10 +588,10 @@ module.exports = (function() {
result.dataValues = _.extend(result.dataValues, values); result.dataValues = _.extend(result.dataValues, values);
result._previousDataValues = _.clone(result.dataValues); result._previousDataValues = _.clone(result.dataValues);
}).tap(function(result) { }).tap(function(result) {
// Run before hook // Run after hook
if (options.hooks) { if (options.hooks) {
return self.Model.runHooks('after' + hook, result); return self.Model.runHooks('after' + hook, result);
} }
}).then(function(result) { }).then(function(result) {
return result; return result;
}); });
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!