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

Commit c907ed02 by Seth Samuel

Save deletedAt without hooks but maintain hooks option for afterDestroy

1 parent bfc083d3
Showing with 1 additions and 2 deletions
...@@ -739,8 +739,7 @@ module.exports = (function() { ...@@ -739,8 +739,7 @@ module.exports = (function() {
if (self.Model._timestampAttributes.deletedAt && options.force === false) { if (self.Model._timestampAttributes.deletedAt && options.force === false) {
self.dataValues[self.Model._timestampAttributes.deletedAt] = new Date(); self.dataValues[self.Model._timestampAttributes.deletedAt] = new Date();
options.hooks = false; return self.save(_.extend(_.clone(options), {hooks : false}));
return self.save(options);
} else { } else {
identifier = self.__options.hasPrimaryKeys ? self.primaryKeyValues : { id: self.id }; identifier = self.__options.hasPrimaryKeys ? self.primaryKeyValues : { id: self.id };
return self.QueryInterface.delete(self, self.QueryInterface.QueryGenerator.addSchema(self.Model), identifier, options); return self.QueryInterface.delete(self, self.QueryInterface.QueryGenerator.addSchema(self.Model), identifier, options);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!