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

Commit fb6a4451 by smihica

modified some needless "or".

1 parent 1eff0488
Showing with 7 additions and 7 deletions
......@@ -809,7 +809,7 @@ Instance.prototype.destroy = function(options) {
options = Utils._.extend({
hooks: true,
force: false
}, options || {});
}, options);
return Promise.bind(this).then(function() {
// Run before hook
......@@ -821,7 +821,7 @@ Instance.prototype.destroy = function(options) {
if (this.Model._timestampAttributes.deletedAt && options.force === false) {
this.setDataValue(this.Model._timestampAttributes.deletedAt, new Date());
return this.save(_.extend(_.clone(options), {hooks : false}));
return this.save(_.extend({}, options, {hooks : false}));
} else {
where = {};
var primaryKeys = this.Model.primaryKeyAttributes;
......@@ -855,7 +855,7 @@ Instance.prototype.restore = function(options) {
options = Utils._.extend({
hooks: true,
force: false
}, options || {});
}, options);
return Promise.bind(this).then(function() {
// Run before hook
......@@ -864,7 +864,7 @@ Instance.prototype.restore = function(options) {
}
}).then(function() {
this.setDataValue(this.Model._timestampAttributes.deletedAt, null);
return this.save(_.extend(_.clone(options), {hooks : false, omitNull : false}));
return this.save(_.extend({}, options, {hooks : false, omitNull : false}));
}).tap(function() {
// Run after hook
if (options.hooks) {
......@@ -913,13 +913,13 @@ Instance.prototype.increment = function(fields, options) {
}
}
options = _.defaults({}, options || {}, {
options = _.defaults({}, options, {
by: 1,
attributes: {},
where: {}
});
where = _.extend(options.where || {}, identifier);
where = _.extend({}, options.where, identifier);
if (Utils._.isString(fields)) {
values[fields] = options.by;
......@@ -970,7 +970,7 @@ Instance.prototype.increment = function(fields, options) {
* @return {Promise}
*/
Instance.prototype.decrement = function(fields, options) {
options = _.defaults({}, options || {}, {
options = _.defaults({}, options, {
by: 1
});
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!