Skip to content

Commit

Permalink
docs(hooks): add info about belongs-to-many (#11601)
Browse files Browse the repository at this point in the history
  • Loading branch information
BigsonLvrocha authored and papb committed Oct 24, 2019
1 parent 843375f commit 7ffa3d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/manual/hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

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
class Projects extends Model {}
Expand Down

0 comments on commit 7ffa3d4

Please sign in to comment.