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 34fe92c6
authored
Jan 06, 2014
by
Mick Hansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix existing include tests
1 parent
1139fa0b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
lib/dialects/abstract/query-generator.js
lib/dialects/abstract/query.js
test/include/findAll.test.js
lib/dialects/abstract/query-generator.js
View file @
34fe92c
...
@@ -502,7 +502,7 @@ module.exports = (function() {
...
@@ -502,7 +502,7 @@ module.exports = (function() {
return
attr
return
attr
}.
bind
(
this
))
}.
bind
(
this
))
mainAttributes
=
mainAttributes
||
(
subQuery
?
[
options
.
table
+
'.*'
]
:
[
'*'
])
mainAttributes
=
mainAttributes
||
(
options
.
include
?
[
options
.
table
+
'.*'
]
:
[
'*'
])
if
(
subQuery
)
{
if
(
subQuery
)
{
subQueryAttributes
=
mainAttributes
subQueryAttributes
=
mainAttributes
...
...
lib/dialects/abstract/query.js
View file @
34fe92c
...
@@ -364,6 +364,7 @@ module.exports = (function() {
...
@@ -364,6 +364,7 @@ module.exports = (function() {
})
})
delete
result
.
__children
delete
result
.
__children
})
})
return
results
return
results
}
}
...
...
test/include/findAll.test.js
View file @
34fe92c
...
@@ -391,11 +391,14 @@ describe(Support.getTestDialectTeaser("Include"), function () {
...
@@ -391,11 +391,14 @@ describe(Support.getTestDialectTeaser("Include"), function () {
Price
Price
]}
]}
],
],
order
:
'id ASC'
order
:
[
[
'Users.id'
,
'ASC'
]
]
}).
done
(
function
(
err
,
users
)
{
}).
done
(
function
(
err
,
users
)
{
expect
(
err
).
not
.
to
.
be
.
ok
expect
(
err
).
not
.
to
.
be
.
ok
users
.
forEach
(
function
(
user
,
i
)
{
users
.
forEach
(
function
(
user
,
i
)
{
user
.
memberships
.
sort
(
sortById
)
user
.
memberships
.
sort
(
sortById
)
expect
(
user
.
memberships
.
length
).
to
.
equal
(
2
)
expect
(
user
.
memberships
.
length
).
to
.
equal
(
2
)
expect
(
user
.
memberships
[
0
].
group
.
name
).
to
.
equal
(
'Developers'
)
expect
(
user
.
memberships
[
0
].
group
.
name
).
to
.
equal
(
'Developers'
)
expect
(
user
.
memberships
[
0
].
rank
.
canRemove
).
to
.
equal
(
1
)
expect
(
user
.
memberships
[
0
].
rank
.
canRemove
).
to
.
equal
(
1
)
...
@@ -1138,8 +1141,6 @@ describe(Support.getTestDialectTeaser("Include"), function () {
...
@@ -1138,8 +1141,6 @@ describe(Support.getTestDialectTeaser("Include"), function () {
expect
(
product
.
prices
.
length
).
to
.
be
.
ok
expect
(
product
.
prices
.
length
).
to
.
be
.
ok
})
})
done
()
done
()
}).
on
(
'sql'
,
function
(
sql
)
{
console
.
log
(
sql
)
})
})
})
})
})
})
...
...
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