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

Commit bbf3d764 by Anuj Joshi Committed by GitHub

fix(docs): fix typo in documentation for polymorphic associations (#13405)

change juncion -> junction
1 parent 0e6955cc
......@@ -223,7 +223,7 @@ Now, to consider a Many-to-Many polymorphic association, instead of considering
The setup for this goes as follows:
* Define the juncion model explicitly, specifying the two foreign keys as `tagId` and `taggableId` (this way it is a junction model for a Many-to-Many relationship between `Tag` and the abstract concept of *taggable*);
* Define the junction model explicitly, specifying the two foreign keys as `tagId` and `taggableId` (this way it is a junction model for a Many-to-Many relationship between `Tag` and the abstract concept of *taggable*);
* Define a string field called `taggableType` in the junction model;
* Define the `belongsToMany` associations between the two models and `Tag`:
* Disabling constraints (i.e. using `{ constraints: false }`), since the same foreign key is referencing multiple tables;
......@@ -424,4 +424,4 @@ WHERE (
We can see that both scopes were applied automatically:
* `` `tag_taggable`.`taggableType` = 'image'`` was added automatically to the `INNER JOIN`;
* `` `tag`.`status` = 'pending'`` was added automatically to an outer where clause.
\ No newline at end of file
* `` `tag`.`status` = 'pending'`` was added automatically to an outer where clause.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!