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 b42bbc7a
authored
Feb 28, 2019
by
Igor Szymanski
Committed by
Sushant
Feb 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(types): enabled string association (#10481)
1 parent
1d3714a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletions
test/integration/include.test.js
types/lib/model.d.ts
test/integration/include.test.js
View file @
b42bbc7
...
...
@@ -913,6 +913,22 @@ describe(Support.getTestDialectTeaser('Include'), () => {
});
});
it
(
'should support eager loading associations using the name of the relation (string)'
,
function
()
{
return
this
.
Team
.
findOne
({
where
:
{
name
:
'TeamA'
},
include
:
[
{
association
:
'members'
,
required
:
true
}
]
}).
then
(
team
=>
{
expect
(
team
.
members
).
to
.
have
.
length
(
2
);
});
});
it
(
'should not ripple grandchild required to top level find when required of child is not given (implicitly false)'
,
function
()
{
return
this
.
Team
.
findAll
({
include
:
[
...
...
types/lib/model.d.ts
View file @
b42bbc7
...
...
@@ -319,7 +319,7 @@ export interface IncludeOptions extends Filterable, Projectable {
/**
* The association you want to eagerly load. (This can be used instead of providing a model/as pair)
*/
association
?:
Association
;
association
?:
Association
|
string
;
/**
* Custom `on` clause, overrides default.
...
...
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