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

You need to sign in or sign up before continuing.
Commit bf30982c by Mick Hansen

eliminate another loop

1 parent 6c9a76dc
Showing with 9 additions and 4 deletions
......@@ -679,6 +679,12 @@ module.exports = (function() {
}
DAOFactory.prototype.bulkBuild = function(valueSets, options) {
options = options || { isNewRecord: true, isDirty: true }
if (options.hasOwnProperty('include') && options.include && !options.includeValidated) {
validateIncludedElements.call(this, options)
}
return valueSets.map(function (values) {
return this.build(values, options)
}.bind(this))
......@@ -1408,6 +1414,7 @@ module.exports = (function() {
include.hasParentRequired = options.hasParentRequired || !!options.required
options.includeMap[include.as] = include
options.includeMap[include.as.substr(0,1).toLowerCase() + include.as.substr(1)] = include
options.includeNames.push(include.as)
options.includeNames.push(include.as.substr(0,1).toLowerCase() + include.as.substr(1))
......
......@@ -215,10 +215,8 @@ module.exports = (function() {
})
}
var include = _.find(this.options.include, function (include) {
return include.as === key || (include.as.slice(0,1).toLowerCase() + include.as.slice(1)) === key
})
var association = include.association
var include = this.options.includeMap[key]
, association = include.association
, self = this
, accessor = Utils._.camelize(key)
, childOptions
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!