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 cb94fa88
authored
Jan 06, 2014
by
Mick Hansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make previous tests run atleast
1 parent
30bd3b08
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
lib/dialects/abstract/query-generator.js
test/include/findAll.test.js
lib/dialects/abstract/query-generator.js
View file @
cb94fa8
...
@@ -538,7 +538,7 @@ module.exports = (function() {
...
@@ -538,7 +538,7 @@ module.exports = (function() {
return
self
.
quoteIdentifier
(
as
)
+
"."
+
self
.
quoteIdentifier
(
attr
)
+
" AS "
+
self
.
quoteIdentifier
(
as
+
"."
+
attr
)
return
self
.
quoteIdentifier
(
as
)
+
"."
+
self
.
quoteIdentifier
(
attr
)
+
" AS "
+
self
.
quoteIdentifier
(
as
+
"."
+
attr
)
})
})
if
(
subQuery
&&
include
.
hasIncludeRequired
||
include
.
required
)
{
if
(
subQuery
&&
(
include
.
hasIncludeRequired
||
include
.
required
)
)
{
subQueryAttributes
=
subQueryAttributes
.
concat
(
attributes
)
subQueryAttributes
=
subQueryAttributes
.
concat
(
attributes
)
}
else
{
}
else
{
mainAttributes
=
mainAttributes
.
concat
(
attributes
)
mainAttributes
=
mainAttributes
.
concat
(
attributes
)
...
@@ -553,7 +553,7 @@ module.exports = (function() {
...
@@ -553,7 +553,7 @@ module.exports = (function() {
})
})
if
(
options
.
includeIgnoreAttributes
!==
false
)
{
if
(
options
.
includeIgnoreAttributes
!==
false
)
{
if
(
subQuery
&&
include
.
hasIncludeRequired
||
include
.
required
)
{
if
(
subQuery
&&
(
include
.
hasIncludeRequired
||
include
.
required
)
)
{
subQueryAttributes
=
subQueryAttributes
.
concat
(
attributes
)
subQueryAttributes
=
subQueryAttributes
.
concat
(
attributes
)
}
else
{
}
else
{
mainAttributes
=
mainAttributes
.
concat
(
throughAttributes
)
mainAttributes
=
mainAttributes
.
concat
(
throughAttributes
)
...
@@ -610,14 +610,14 @@ module.exports = (function() {
...
@@ -610,14 +610,14 @@ module.exports = (function() {
options
.
include
.
forEach
(
function
(
include
)
{
options
.
include
.
forEach
(
function
(
include
)
{
var
joinQueryItem
=
generateJoinQuery
(
include
,
tableName
)
var
joinQueryItem
=
generateJoinQuery
(
include
,
tableName
)
if
(
include
.
hasIncludeWhere
||
include
.
where
)
{
if
(
subQuery
&&
(
include
.
hasIncludeWhere
||
include
.
where
)
)
{
subJoinQueries
.
push
(
joinQueryItem
)
subJoinQueries
.
push
(
joinQueryItem
)
}
else
{
}
else
{
mainJoinQueries
.
push
(
joinQueryItem
)
mainJoinQueries
.
push
(
joinQueryItem
)
}
}
}.
bind
(
this
))
}.
bind
(
this
))
}
}
if
(
subQuery
)
{
if
(
subQuery
)
{
subQueryItems
.
push
(
"SELECT "
+
subQueryAttributes
.
join
(
','
)
+
" FROM "
+
options
.
table
)
subQueryItems
.
push
(
"SELECT "
+
subQueryAttributes
.
join
(
','
)
+
" FROM "
+
options
.
table
)
subQueryItems
.
push
(
subJoinQueries
.
join
(
''
))
subQueryItems
.
push
(
subJoinQueries
.
join
(
''
))
...
...
test/include/findAll.test.js
View file @
cb94fa8
...
@@ -889,7 +889,7 @@ describe(Support.getTestDialectTeaser("Include"), function () {
...
@@ -889,7 +889,7 @@ describe(Support.getTestDialectTeaser("Include"), function () {
})
})
})
})
it
.
only
(
'should be possible to extend the on clause with a where option on nested includes'
,
function
(
done
)
{
it
(
'should be possible to extend the on clause with a where option on nested includes'
,
function
(
done
)
{
var
User
=
this
.
sequelize
.
define
(
'User'
,
{})
var
User
=
this
.
sequelize
.
define
(
'User'
,
{})
,
Product
=
this
.
sequelize
.
define
(
'Product'
,
{
,
Product
=
this
.
sequelize
.
define
(
'Product'
,
{
title
:
DataTypes
.
STRING
title
:
DataTypes
.
STRING
...
...
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