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

Commit cc9638ab by Mick Hansen

rename persistSideEffects to sideEffects

1 parent 400cbe76
Showing with 4 additions and 4 deletions
...@@ -1577,7 +1577,7 @@ module.exports = (function() { ...@@ -1577,7 +1577,7 @@ module.exports = (function() {
* @param {Array} [options.fields] Fields to update (defaults to all fields) * @param {Array} [options.fields] Fields to update (defaults to all fields)
* @param {Boolean} [options.validate=true] Should each row be subject to validation before it is inserted. The whole insert will fail if one row fails validation * @param {Boolean} [options.validate=true] Should each row be subject to validation before it is inserted. The whole insert will fail if one row fails validation
* @param {Boolean} [options.hooks=true] Run before / after bulk update hooks? * @param {Boolean} [options.hooks=true] Run before / after bulk update hooks?
* @param {Boolean} [options.persistSideEffects=true] Whether or not to update the side effects of any virtual setters. * @param {Boolean} [options.sideEffects=true] Whether or not to update the side effects of any virtual setters.
* @param {Boolean} [options.individualHooks=false] Run before / after update hooks?. If true, this will execute a SELECT followed by individual UPDATEs. A select is needed, because the row data needs to be passed to the hooks * @param {Boolean} [options.individualHooks=false] Run before / after update hooks?. If true, this will execute a SELECT followed by individual UPDATEs. A select is needed, because the row data needs to be passed to the hooks
* @param {Boolean} [options.returning=false] Return the affected rows (only for postgres) * @param {Boolean} [options.returning=false] Return the affected rows (only for postgres)
* @param {Number} [options.limit] How many rows to update (only for mysql and mariadb) * @param {Number} [options.limit] How many rows to update (only for mysql and mariadb)
...@@ -1598,7 +1598,7 @@ module.exports = (function() { ...@@ -1598,7 +1598,7 @@ module.exports = (function() {
individualHooks: false, individualHooks: false,
returning: false, returning: false,
force: false, force: false,
persistSideEffects: true sideEffects: true
}, options || {}); }, options || {});
options.type = QueryTypes.BULKUPDATE; options.type = QueryTypes.BULKUPDATE;
...@@ -1633,7 +1633,7 @@ module.exports = (function() { ...@@ -1633,7 +1633,7 @@ module.exports = (function() {
var build = self.build(values); var build = self.build(values);
build.set(self._timestampAttributes.updatedAt, values[self._timestampAttributes.updatedAt], { raw: true }); build.set(self._timestampAttributes.updatedAt, values[self._timestampAttributes.updatedAt], { raw: true });
if ( options.persistSideEffects ) { if (options.sideEffects) {
values = Utils._.assign(values, Utils._.pick(build.get(), build.changed())); values = Utils._.assign(values, Utils._.pick(build.get(), build.changed()));
options.fields = Utils._.union(options.fields, Object.keys(values)); options.fields = Utils._.union(options.fields, Object.keys(values));
} }
......
...@@ -1002,7 +1002,7 @@ describe(Support.getTestDialectTeaser('Model'), function() { ...@@ -1002,7 +1002,7 @@ describe(Support.getTestDialectTeaser('Model'), function() {
where: { where: {
username: 'Jan' username: 'Jan'
}, },
persistSideEffects: false sideEffects: false
}); });
}).then(function (user) { }).then(function (user) {
return User.findAll(); return User.findAll();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!