Skip to content

docs: note callbacks=false and declare-time checks for dependent= - #4455

Merged
bpamiri merged 2 commits into
developfrom
peter/consumer-docs-dependents
Oct 6, 2026
Merged

bpamiri merged 2 commits into
developfrom
peter/consumer-docs-dependents

Conversation

@bpamiri

@bpamiri bpamiri commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

This follows up #4394 in the consumer models.md (and its wheels new template copy). One line in the dependent= section:

  • callbacks=false: delete(callbacks=false) on the parent now skips the dependents' callbacks too (model/associations.cfm passes callbacks to every dependent call).
  • Invalid values: an unsupported dependent value throws Wheels.InvalidArgument when the association is declared ($validateDependent), not on the first delete.

tools/build/scripts/ship-consumer-docs.sh check passes, and the template copy is identical.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Peter Amiri <peter@alurium.com>
@bpamiri bpamiri added this to the v4.2.0 milestone Oct 6, 2026
@github-actions github-actions Bot added the docs label Oct 6, 2026
@bpamiri

bpamiri commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator Author

Review: head 2030aee. APPROVE (docs), with one LOW.

  • callbacks=false. It matches fix(model): dependent deletes follow callbacks = false; check dependent when declared #4394 (32b1bdd): $deleteDependents() forwards callbacks in all four dependent= branches, so the parent's delete(callbacks=false) skips the children's callbacks.
  • Declaration check. It matches too: hasMany() and hasOne() call $validateDependent() (associations.cfm:75,132), which throws Wheels.InvalidArgument for anything except delete, deleteAll, remove, removeAll or false.
  • Both .ai/models.md copies are byte-identical. The line sits in the dependent= section.

LOW: "surfaces at app start". Wheels doesn't load models at application start (onapplicationstart.cfc has no eager model loading). A model's config(), and so the hasMany / hasOne declaration, runs the first time the model is used. Suggest: "...throws Wheels.InvalidArgument when the association is declared (the first time the model loads), not on the first delete."

The final follows PR CI (plus the LOW, if you take it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Peter Amiri <peter@alurium.com>
@bpamiri
bpamiri merged commit ae1bbe5 into develop Oct 6, 2026
18 checks passed
@bpamiri
bpamiri deleted the peter/consumer-docs-dependents branch October 6, 2026 02:00
@bpamiri

bpamiri commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator Author

FINAL: APPROVE (recorded after merge). Head c8814f1. Docs only: the dependent= line in both .ai/models.md copies (identical), with the LOW fixed ("the first time the model loads"). PR CI: 16 pass, 0 fail, 0 pending, 2 skipping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant