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

Commit 6f7200c0 by Mick Hansen

Merge pull request #4065 from kenkouot/hotfix/clone-object-reference

Hotfix: Wrap referenced options arguments in _.clone
2 parents c0795cf0 f9bb8ae6
Showing with 3 additions and 3 deletions
......@@ -1236,7 +1236,7 @@ Model.prototype.findById = function(param, options) {
return Promise.resolve(null);
}
options = options || {};
options = optClone(options) || {};
if (typeof param === 'number' || typeof param === 'string' || Buffer.isBuffer(param)) {
options.where = {};
......@@ -1724,7 +1724,7 @@ Model.prototype.findOrCreate = function(options) {
* @return {Promise<created>} Returns a boolean indicating whether the row was created or updated.
*/
Model.prototype.upsert = function (values, options) {
options = options || {};
options = optClone(options) || {};
if (!options.fields) {
options.fields = Object.keys(this.attributes);
......@@ -1932,7 +1932,7 @@ Model.prototype.bulkCreate = function(records, options) {
* @see {Model#destroy} for more information
*/
Model.prototype.truncate = function(options) {
options = options || {};
options = optClone(options) || {};
options.truncate = true;
return this.destroy(options);
};
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!