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

Commit 88f396b2 by Mick Hansen

fix hooks

1 parent 4cf1cc77
Showing with 13 additions and 2 deletions
...@@ -338,7 +338,18 @@ module.exports = (function() { ...@@ -338,7 +338,18 @@ module.exports = (function() {
} }
// redeclare our new values // redeclare our new values
args[2] = newValues || args[2] values = newValues || values
tmpVals = values
values = {}
options.fields.forEach(function(field) {
if (tmpVals[field] !== undefined) {
values[field] = tmpVals[field]
}
})
args[2] = values
self.set(values, {raw: true})
self.QueryInterface[query].apply(self.QueryInterface, args) self.QueryInterface[query].apply(self.QueryInterface, args)
.on('sql', function(sql) { .on('sql', function(sql) {
......
...@@ -1106,7 +1106,7 @@ describe(Support.getTestDialectTeaser("Hooks"), function () { ...@@ -1106,7 +1106,7 @@ describe(Support.getTestDialectTeaser("Hooks"), function () {
}) })
describe('#create', function() { describe('#create', function() {
describe('via deifne', function() { describe('via define', function() {
describe('on success', function() { describe('on success', function() {
describe('with a single hook', function() { describe('with a single hook', function() {
it('should return the user from the callback', function(done) { it('should return the user from the callback', function(done) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!