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 4d5380cc
authored
Feb 15, 2014
by
Overlook Motel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix problem with 'this' in validateIncludedElement
1 parent
8a832076
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
lib/dao-factory.js
lib/dao-factory.js
View file @
4d5380c
...
...
@@ -1348,7 +1348,7 @@ module.exports = (function() {
}
options
.
include
=
options
.
include
.
map
(
function
(
include
)
{
include
=
validateIncludedElement
.
call
(
this
,
include
,
options
.
daoFactory
,
tableNames
)
include
=
validateIncludedElement
.
call
(
this
,
include
,
tableNames
)
options
.
includeMap
[
include
.
as
]
=
include
options
.
includeNames
.
push
(
include
.
as
)
...
...
@@ -1364,15 +1364,11 @@ module.exports = (function() {
}.
bind
(
this
))
}
var
validateIncludedElement
=
function
(
include
,
parent
,
tableNames
)
{
var
validateIncludedElement
=
function
(
include
,
tableNames
)
{
if
(
include
instanceof
DAOFactory
)
{
include
=
{
daoFactory
:
include
}
}
if
(
typeof
parent
===
"undefined"
)
{
parent
=
this
}
if
(
typeof
include
!==
'object'
)
{
throw
new
Error
(
'Include unexpected. Element has to be either an instance of DAOFactory or an object.'
)
}
...
...
@@ -1405,7 +1401,7 @@ module.exports = (function() {
if
(
include
.
_pseudo
)
return
include
// check if the current daoFactory is actually associated with the passed daoFactory - or it's a pseudo include
var
association
=
parent
.
getAssociation
(
include
.
daoFactory
,
include
.
as
)
var
association
=
this
.
getAssociation
(
include
.
daoFactory
,
include
.
as
)
if
(
association
)
{
include
.
association
=
association
include
.
as
=
association
.
as
...
...
@@ -1434,7 +1430,7 @@ module.exports = (function() {
// Validate child includes
if
(
include
.
hasOwnProperty
(
'include'
))
{
validateIncludedElements
(
include
,
tableNames
)
validateIncludedElements
.
call
(
include
.
daoFactory
,
include
,
tableNames
)
}
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