Skip to content

test: cover has-one-through initial constraints - #326

Open
elpete wants to merge 1 commit into
nextfrom
test/119-has-one-through-constraints
Open

test: cover has-one-through initial constraints#326
elpete wants to merge 1 commit into
nextfrom
test/119-has-one-through-constraints

Conversation

@elpete

@elpete elpete commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Closes #119

Review

This bug report is a strong fit for Quick. A hasOneThrough chain should support any valid relationship as its first hop, including hasOne; otherwise composition depends on an internal subclass detail.

Recommendation: 10/10.

Reasons for

  • Relationship chains should behave consistently across hasOne and hasMany first hops.
  • The failure was an internal method-placement bug, not an unsupported relationship shape.
  • The exact scenario is compact to preserve through the public API.

Reasons against

  • Deep relationship SQL is inherently more complex, so every additional relationship combination expands the regression surface.

Attempted reproduction

I modeled the same relationship shape through the public API: User.favoritePost is a hasOne, and Post.author is a belongsTo; User.favoritePostAuthor composes them with hasOneThrough.

The historical initialThroughConstraints missing-method error no longer reproduces on current next with qb@14.0.0-beta.3. Commit 7b3b8d0 moved initialThroughConstraints() from HasMany to the shared HasOneOrMany implementation. This PR adds direct public-API coverage for that fix.

Validation

  • Focused has-one-through spec: 2 passed, 0 failed, 0 errors
  • Full suite: 496 passed, 0 failed, 0 errors, 3 skipped
  • Formatter completed
  • git diff --check passed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant