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 14b6dba2
authored
Jan 26, 2015
by
Björn Dahlgren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs(associations): missing curly brackets in Belongs-To-Many
1 parent
f980f1e2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
docs/docs/associations.md
docs/docs/associations.md
View file @
14b6dba
...
...
@@ -88,8 +88,8 @@ But we want more! Let's define it the other way around by creating a many to man
Belongs-To-Many associations are used to connect sources with multiple targets. Furthermore the targets can also have connections to multiple sources.
```
js
Project
.
belongsToMany
(
User
,
{
through
:
'UserProject'
);
User
.
belongsToMany
(
Project
,
{
through
:
'UserProject'
);
Project
.
belongsToMany
(
User
,
{
through
:
'UserProject'
}
);
User
.
belongsToMany
(
Project
,
{
through
:
'UserProject'
}
);
```
This will reate a new model called UserProject with with the equivalent foreign keys
`ProjectId`
and
`UserId`
. Whether the attributes are camelcase or not depends on the two models joined by the table (in this case User and Project).
...
...
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