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

Commit 1522ec17 by Malte Legenhausen

Build default parameter are now set when an options object is given

1 parent dc069be5
Showing with 8 additions and 2 deletions
...@@ -955,7 +955,10 @@ module.exports = (function() { ...@@ -955,7 +955,10 @@ module.exports = (function() {
if (Array.isArray(values)) { if (Array.isArray(values)) {
return this.bulkBuild(values, options); return this.bulkBuild(values, options);
} }
options = options || { isNewRecord: true, isDirty: true }; options = Utils._.extend({
isNewRecord: true,
isDirty: true
}, options || {});
if (options.attributes) { if (options.attributes) {
options.attributes = options.attributes.map(function(attribute) { options.attributes = options.attributes.map(function(attribute) {
...@@ -976,7 +979,10 @@ module.exports = (function() { ...@@ -976,7 +979,10 @@ module.exports = (function() {
Model.prototype.bulkBuild = function(valueSets, options) { Model.prototype.bulkBuild = function(valueSets, options) {
options = options || { isNewRecord: true, isDirty: true }; options = Utils._.extend({
isNewRecord: true,
isDirty: true
}, options || {});
if (!options.includeValidated) { if (!options.includeValidated) {
conformOptions(options); conformOptions(options);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!