-
Notifications
You must be signed in to change notification settings - Fork 538
Closed
Description
This issue is a (choose one):
- Problem/bug report.
- Feature request.
- Request for support. Note: Please try to avoid submitting issues for support requests. Use Gitter instead.
Checklist before submitting:
- I've searched for an existing issue.
- I've asked my question on Gitter and have not received a satisfactory answer.
- I've included a complete bug report template. This step helps us and allows us to see the bug without trying to reproduce the problem from your description. It helps you because you will frequently detect if it's a problem specific to your project.
- The feature I'm asking for is compliant with the JSON:API spec.
Description
When including a resource on a paginated list with only one element on the page, the response does not contain any includes.
Example:
6 Elements in total, 5 per page, page number 2 of some resource.
The reason are the lines:
https://github.com/cerebris/jsonapi-resources/blame/5dfeb0f741e3fc98ee9786f7eb182b15f391ca63/lib/jsonapi/active_relation_resource_finder.rb#L184-L190
paginator = options[:paginator]
# ToDO: Remove count check. Currently pagination isn't working with multiple source_rids (i.e. it only works
# for show relationships, not related includes).
if paginator && source_rids.count == 1
records = related_klass.apply_pagination(records, paginator, order_options)
end
What is the reason for these lines? Currently, I am not sure what effect it has to purely remove these lines because it does not seem to make a noticeable difference to me (expect for fixing the bug described above).
Metadata
Metadata
Assignees
Labels
No labels