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

Commit 88f396b2 by Mick Hansen

fix hooks

1 parent 4cf1cc77
Showing with 14 additions and 3 deletions
......@@ -259,7 +259,7 @@ module.exports = (function() {
values[field] = tmpVals[field]
}
})
for (var attrName in self.daoFactory.rawAttributes) {
if (self.daoFactory.rawAttributes.hasOwnProperty(attrName)) {
var definition = self.daoFactory.rawAttributes[attrName]
......@@ -338,7 +338,18 @@ module.exports = (function() {
}
// 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)
.on('sql', function(sql) {
......
......@@ -1106,7 +1106,7 @@ describe(Support.getTestDialectTeaser("Hooks"), function () {
})
describe('#create', function() {
describe('via deifne', function() {
describe('via define', function() {
describe('on success', function() {
describe('with a single hook', function() {
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!