Sitelet https://github.com/jsonapi-serializer/jsonapi-serializer/pull/153
Skip to content

Fix lazy loaded nested associations - #153

Closed
tlconnor wants to merge 1 commit into
jsonapi-serializer:masterfrom
tlconnor:fixLazyRelationships
Closed

tlconnor wants to merge 1 commit into
jsonapi-serializer:masterfrom
tlconnor:fixLazyRelationships

Conversation

@tlconnor

@tlconnor tlconnor commented Dec 7, 2020 •

Copy link
Copy Markdown

Closes #129

What is the current behavior?

Relationships blocks are empty when including nested lazy loaded relationships.

What is the new behavior?

Relationship blocks are properly populated when including nested lazy loaded relationships. The behavior is now consistent with the non-lazy behavior.

The root cause of the problem was that the includes_list passed to #record_hash was not correctly formatted, resulting in included always being false. The behavior of #record_hash is now consistent with #get_included_records.

Checklist

Please make sure the following requirements are complete:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes /
    features)
  • All automated checks pass (CI/CD)

@tlconnor

tlconnor commented Dec 7, 2020

Copy link
Copy Markdown
Author

Looks like I missed something. Closing this PR until fixed.

@tlconnor tlconnor closed this Dec 7, 2020
@stas

stas commented Dec 7, 2020

Copy link
Copy Markdown
Collaborator

No worries @tlconnor!

Btw, we will be reworking the lazy loading API in the #141

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.

Lazy Load Data does not respect inclusion of nested associations

2 participants