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

Commit 9b22f127 by Mick Hansen

Don't check for existing results if no multi associations are included

1 parent df42db65
...@@ -343,7 +343,7 @@ module.exports = (function() { ...@@ -343,7 +343,7 @@ module.exports = (function() {
row = Dot.transform(row) row = Dot.transform(row)
calleeData = _.omit(row, calleeDataIgnore) calleeData = _.omit(row, calleeDataIgnore)
existingResult = _.find(results, function (result) { existingResult = options.hasMultiAssociation && _.find(results, function (result) {
if (calleeDataIgnore) { if (calleeDataIgnore) {
return Utils._.isEqual(_.omit(result, calleeDataIgnore), calleeData) return Utils._.isEqual(_.omit(result, calleeDataIgnore), calleeData)
} }
......
...@@ -711,7 +711,13 @@ module.exports = (function() { ...@@ -711,7 +711,13 @@ module.exports = (function() {
} }
var sql = this.QueryGenerator.selectQuery(tableName, options, factory) var sql = this.QueryGenerator.selectQuery(tableName, options, factory)
queryOptions = Utils._.extend({}, queryOptions, { include: options.include, includeNames: options.includeNames, includeMap: options.includeMap }) queryOptions = Utils._.extend({}, queryOptions, {
include: options.include,
includeNames: options.includeNames,
includeMap: options.includeMap,
hasSingleAssociation: options.hasSingleAssociation,
hasMultiAssociation: options.hasMultiAssociation
})
return queryAndEmit.call(this, [sql, factory, queryOptions], 'select') return queryAndEmit.call(this, [sql, factory, queryOptions], 'select')
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!