Skip to content

Commit 15f9949

Browse files
docs(web/guides): note shortcut name accepted in findAll include for many-to-many
Signed-off-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
1 parent 0a1a2fa commit 15f9949

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

web/sites/guides/src/content/docs/v4-0-0/basics/associations.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ component extends="Model" {
239239
}
240240
```
241241

242-
A single `hasMany` with `shortcut` provides both access paths: `user.userRoles()` for the join rows and `user.roles()` for the far-side records. Behind the scenes Wheels walks both association chains to build the query. The same declaration also works correctly with `include``model("User").findAll(include="userRoles")` joins the join table as expected.
242+
A single `hasMany` with `shortcut` provides both access paths: `user.userRoles()` for the join rows and `user.roles()` for the far-side records. Behind the scenes Wheels walks both association chains to build the query. Both names also work in `include`: `model("User").findAll(include="userRoles")` loads just the join rows, and `model("User").findAll(include="roles")` uses the shortcut name to load the far-side records through the bridge in one step (Wheels expands it to `userRoles(role)` automatically).
243243

244244
The join model needs both `belongsTo` declarations:
245245

0 commit comments

Comments
 (0)