Commit 2c4e452
Fix unstable ordering in Book associations for PostgreSQL
Add explicit ordering by id to Book's book_comments and
approved_book_comments associations. Without explicit ordering,
PostgreSQL returns relationship data in non-deterministic order,
causing cache test failures where warmup response differs from
normal response.
The previous fix added default_sort to BookCommentResource, which
handles collection queries, but didn't affect relationship linkage
data in included resources. This fix ensures stable ordering at
the ActiveRecord association level.
Fixes: RequestTest#test_pagination_related_resources_data_includes
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 0914344 commit 2c4e452
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
647 | 647 | | |
648 | 648 | | |
649 | 649 | | |
650 | | - | |
651 | | - | |
| 650 | + | |
| 651 | + | |
652 | 652 | | |
653 | 653 | | |
654 | 654 | | |
| |||
0 commit comments