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 d311b2c2
authored
Apr 09, 2014
by
José Moreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test for #1614
1 parent
c6bd7b2e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
test/associations/has-many.test.js
test/associations/has-many.test.js
View file @
d311b2c
...
@@ -698,6 +698,30 @@ describe(Support.getTestDialectTeaser("HasMany"), function() {
...
@@ -698,6 +698,30 @@ describe(Support.getTestDialectTeaser("HasMany"), function() {
})
})
})
})
it
(
"get associated objects with an eager load with conditions but not required"
,
function
(
done
)
{
var
Label
=
this
.
sequelize
.
define
(
'Label'
,
{
'title'
:
DataTypes
.
STRING
,
'isActive'
:
DataTypes
.
BOOLEAN
})
,
Task
=
this
.
Task
Task
.
hasMany
(
Label
)
Label
.
hasMany
(
Task
)
Label
.
sync
({
force
:
true
}).
success
(
function
()
{
this
.
User
.
find
({
where
:
{
username
:
'John'
},
include
:
[
{
model
:
this
.
Task
,
required
:
false
,
include
:
[
{
model
:
this
.
Label
,
required
:
false
,
where
:
{
active
:
1
}
}
]}
]
}).
done
(
function
(
err
,
john
)
{
expect
(
err
).
not
.
to
.
be
.
ok
expect
(
john
.
tasks
).
to
.
have
.
length
(
2
);
done
();
})
})
})
it
(
'should support schemas'
,
function
(
done
)
{
it
(
'should support schemas'
,
function
(
done
)
{
var
self
=
this
var
self
=
this
,
AcmeUser
=
self
.
sequelize
.
define
(
'User'
,
{
,
AcmeUser
=
self
.
sequelize
.
define
(
'User'
,
{
...
...
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