Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relationship data for include missing #74

Open
blmundie opened this issue May 13, 2016 · 2 comments
Open

Relationship data for include missing #74

blmundie opened this issue May 13, 2016 · 2 comments

Comments

@blmundie
Copy link

I think this might be related to #47. When including posts the relationship data for posts is included, but for posts.users the relationship data for posts is not included. posts,posts.users works

The line direct_children_includes = includes.reject { |key| key.include?('.') } in serializer.rb:267 seems to cause this. Changing it to direct_children_includes = includes.reject { |key| key.split('.')[0] } fixes this. I couldn't tell if this is intended or not, because there is a test that checks for it.

@fotinakis
Copy link
Owner

fotinakis commented May 13, 2016

Hmm, that's not intentional. In a pre-1.0 version of the spec, the spec said to only include leaf nodes for includes, but in the 1.0 spec they changed it to include all parent nodes as well. There was a PR that fixed it (#50) and I thought we have good test coverage for making sure that this works correctly. You're definitely using the latest version of this gem? Also, #47 that you referenced was actually caused by him overriding format_name and a bad interaction with strings/symbols—have you overridden format_name?

@blmundie
Copy link
Author

Yes, I'm definitely using the latest version. It looks to me that the tests on line 705 and 739 test for this.

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

No branches or pull requests

2 participants