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

Commit 7ffa3d40 by Luiz Victor Linhares Rocha Committed by Pedro Augusto de Paula Barbosa

docs(hooks): add info about belongs-to-many (#11601)

1 parent 843375f5
Showing with 2 additions and 1 deletions
...@@ -332,7 +332,8 @@ User.beforeBulkCreate((users, options) => { ...@@ -332,7 +332,8 @@ User.beforeBulkCreate((users, options) => {
For the most part hooks will work the same for instances when being associated except a few things For the most part hooks will work the same for instances when being associated except a few things
1. When using add/set functions the beforeUpdate/afterUpdate hooks will run. 1. When using add/set functions the beforeUpdate/afterUpdate hooks will run.
2. The only way to call beforeDestroy/afterDestroy hooks are on associations with `onDelete: 'cascade'` and the option `hooks: true`. For instance: 2. When using add functions for belongsToMany relationships that will add record to pivot table, beforeBulkCreate/afterBulkCreate hooks in intermediate model will run.
3. The only way to call beforeDestroy/afterDestroy hooks are on associations with `onDelete: 'cascade'` and the option `hooks: true`. For instance:
```js ```js
class Projects extends Model {} class Projects extends Model {}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!