不要怂,就是干,撸起袖子干!

Commit 14b6dba2 by Björn Dahlgren

docs(associations): missing curly brackets in Belongs-To-Many

1 parent f980f1e2
Showing with 2 additions and 2 deletions
...@@ -88,8 +88,8 @@ But we want more! Let's define it the other way around by creating a many to man ...@@ -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. Belongs-To-Many associations are used to connect sources with multiple targets. Furthermore the targets can also have connections to multiple sources.
```js ```js
Project.belongsToMany(User, {through: 'UserProject'); Project.belongsToMany(User, {through: 'UserProject'});
User.belongsToMany(Project, {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). 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).
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!