Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc(hook): add info about belongsToMany #11601

Merged
merged 3 commits into from
Oct 24, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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