Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cli/lucli/templates/app/.ai/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ hasMany(name="comments", dependent="delete");

On `hasOne`, `delete` and `deleteAll` both load the child and call `delete()`; `remove` and `removeAll` both go through `update()`.

`delete(callbacks=false)` on the parent skips the dependents' callbacks too. An unsupported `dependent` value throws `Wheels.InvalidArgument` when the association is declared (the first time the model loads), not on the first delete.

Order inside the parent's `delete()` transaction: the parent's `beforeDelete`, then the dependents, then the parent row, then `afterDelete`. If `beforeDelete` returns `false` nothing is deleted; if the parent delete fails, the children's changes roll back with it. `deleteAll()` on the parent without `instantiate=true` runs no callbacks and no `dependent=`.

## Bulk writes: `insertAll` / `upsertAll`
Expand Down
2 changes: 2 additions & 0 deletions docs/consumer-ai/.ai/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ hasMany(name="comments", dependent="delete");

On `hasOne`, `delete` and `deleteAll` both load the child and call `delete()`; `remove` and `removeAll` both go through `update()`.

`delete(callbacks=false)` on the parent skips the dependents' callbacks too. An unsupported `dependent` value throws `Wheels.InvalidArgument` when the association is declared (the first time the model loads), not on the first delete.

Order inside the parent's `delete()` transaction: the parent's `beforeDelete`, then the dependents, then the parent row, then `afterDelete`. If `beforeDelete` returns `false` nothing is deleted; if the parent delete fails, the children's changes roll back with it. `deleteAll()` on the parent without `instantiate=true` runs no callbacks and no `dependent=`.

## Bulk writes: `insertAll` / `upsertAll`
Expand Down
Loading