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

Commit 67eb9800 by Tim Perry

Pass full options to validateIncludedElements, not options.raw

1 parent 6a7b2178
Showing with 4 additions and 4 deletions
...@@ -437,7 +437,7 @@ var validateIncludedElements = function(options, tableNames) { ...@@ -437,7 +437,7 @@ var validateIncludedElements = function(options, tableNames) {
// validate all included elements // validate all included elements
var includes = options.include; var includes = options.include;
for (var index = 0; index < includes.length; index++) { for (var index = 0; index < includes.length; index++) {
var include = includes[index] = validateIncludedElement.call(this, includes[index], tableNames, options.raw); var include = includes[index] = validateIncludedElement.call(this, includes[index], tableNames, options);
include.parent = options; include.parent = options;
// associations that are required or have a required child and is not a ?:M association are candidates for the subquery // associations that are required or have a required child and is not a ?:M association are candidates for the subquery
...@@ -461,7 +461,7 @@ var validateIncludedElements = function(options, tableNames) { ...@@ -461,7 +461,7 @@ var validateIncludedElements = function(options, tableNames) {
}; };
Model.$validateIncludedElements = validateIncludedElements; Model.$validateIncludedElements = validateIncludedElements;
validateIncludedElement = function(include, tableNames, raw) { validateIncludedElement = function(include, tableNames, options) {
if (!include.hasOwnProperty('model') && !include.hasOwnProperty('association')) { if (!include.hasOwnProperty('model') && !include.hasOwnProperty('association')) {
throw new Error('Include malformed. Expected attributes: model or association'); throw new Error('Include malformed. Expected attributes: model or association');
} }
...@@ -476,7 +476,7 @@ validateIncludedElement = function(include, tableNames, raw) { ...@@ -476,7 +476,7 @@ validateIncludedElement = function(include, tableNames, raw) {
tableNames[include.model.getTableName()] = true; tableNames[include.model.getTableName()] = true;
if (include.attributes && !raw) { if (include.attributes && !options.raw) {
include.originalAttributes = include.attributes.slice(0); include.originalAttributes = include.attributes.slice(0);
if (include.attributes.length) { if (include.attributes.length) {
...@@ -536,7 +536,7 @@ validateIncludedElement = function(include, tableNames, raw) { ...@@ -536,7 +536,7 @@ validateIncludedElement = function(include, tableNames, raw) {
// Validate child includes // Validate child includes
if (include.hasOwnProperty('include')) { if (include.hasOwnProperty('include')) {
validateIncludedElements.call(include.model, include, tableNames, raw); validateIncludedElements.call(include.model, include, tableNames, options);
} }
return include; return include;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!