Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 67eb9800
authored
Jul 03, 2015
by
Tim Perry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass full options to validateIncludedElements, not options.raw
1 parent
6a7b2178
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
lib/model.js
lib/model.js
View file @
67eb980
...
...
@@ -437,7 +437,7 @@ var validateIncludedElements = function(options, tableNames) {
// validate all included elements
var
includes
=
options
.
include
;
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
;
// 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) {
};
Model
.
$validateIncludedElements
=
validateIncludedElements
;
validateIncludedElement
=
function
(
include
,
tableNames
,
raw
)
{
validateIncludedElement
=
function
(
include
,
tableNames
,
options
)
{
if
(
!
include
.
hasOwnProperty
(
'model'
)
&&
!
include
.
hasOwnProperty
(
'association'
))
{
throw
new
Error
(
'Include malformed. Expected attributes: model or association'
);
}
...
...
@@ -476,7 +476,7 @@ validateIncludedElement = function(include, tableNames, raw) {
tableNames
[
include
.
model
.
getTableName
()]
=
true
;
if
(
include
.
attributes
&&
!
raw
)
{
if
(
include
.
attributes
&&
!
options
.
raw
)
{
include
.
originalAttributes
=
include
.
attributes
.
slice
(
0
);
if
(
include
.
attributes
.
length
)
{
...
...
@@ -536,7 +536,7 @@ validateIncludedElement = function(include, tableNames, raw) {
// Validate child includes
if
(
include
.
hasOwnProperty
(
'include'
))
{
validateIncludedElements
.
call
(
include
.
model
,
include
,
tableNames
,
raw
);
validateIncludedElements
.
call
(
include
.
model
,
include
,
tableNames
,
options
);
}
return
include
;
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment