Skip to content

Conversation

ArneZsng
Copy link
Contributor

@ArneZsng ArneZsng commented Jun 20, 2018

All Submissions:

  • I've checked to ensure there aren't other open Pull Requests for the same update/change.
  • I've submitted a ticket for my issue if one did not already exist.
  • My submission passes all tests. (Please run the full test suite locally to cut down on noise from travis failures.)
  • I've used Github auto-closing keywords in the commit message or the description.
  • I've added/updated tests for this change.

Bug fixes and Changes to Core Features:

  • I've included an explanation of what the changes do and why I'd like you to include them.
  • I've provided test(s) that fails without the change.

Test Plan:

Reviewer Checklist:

  • Maintains compliance with JSON:API
  • Adequate test coverage exists to prevent regressions

Fixes #1162. The issue is that nested resources as well as included resources use find_related_monomorphic_fragments in a similar fashion. If we query nested resources, we want pagination to have an effect on the nested resources. If we include resources (at least currently) we don't want the pagination for the main resource to have an effect on the included resources. Thus, we have to differentiate between the two cases.

The issue in #1162 is that if some page of the main resource has only 1 resource, the condition to apply pagination (source_rids.count == 1) would be true and thus no includes are loaded.

@lgebhardt lgebhardt merged commit 7136bdd into cerebris:master Jul 3, 2018
@lgebhardt
Copy link
Member

@ArneZsng Thanks!

@ArneZsng ArneZsng deleted the hotfix-master/allow-pagination-for-nested-resources-but-not-includes branch July 3, 2018 12:39
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.

Related resources are not included if there is only one element on page
2 participants