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

Commit 07b8e9f5 by Mick Hansen

please work

1 parent ac5fae53
Showing with 9 additions and 2 deletions
......@@ -376,13 +376,20 @@ module.exports = (function() {
.proxy(emitter, {events: ['sql', 'error']})
.success(function(result) {
values = _.extend(values, result.values) // Transfer database generated values (defaults, autoincrement, etc)
// Hook might fail, but since the query succeded the values should be available anyways
result.dataValues = _.extend(result.dataValues, values)
result._previousDataValues = _.clone(result.dataValues)
self.__factory.runHooks('after' + hook, values, function(err, newValues) {
if (!!err) {
return emitter.emit('error', err)
}
result.dataValues = _.extend(result.dataValues, newValues)
result._previousDataValues = _.clone(result.dataValues)
if (newValues) {
result.dataValues = _.extend(result.dataValues, newValues)
result._previousDataValues = _.clone(result.dataValues)
}
emitter.emit('success', result)
})
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!