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

Simplify Include Directives Hash #1311

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tommy-russoniello
Copy link
Collaborator

This simplifies include directives hashes by removing the include_related subhash under each entity. This indirection exists because of an include key that used to be in each hash, but was removed. Since there are never any other keys in the hashes, the include_related subhashes are no longer necessary.

In doing this, I also found (and fixed) a small bug where the processor tries to use an include directives hash as a key for its own subhash instead of the symbol :include_related.


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.

New Feature Submissions:

  • I've submitted an issue that describes this feature, and received the go ahead from the maintainers.
  • My submission includes new tests.
  • My submission maintains compliance with JSON:API.

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

@@ -4329,7 +4329,8 @@ def test_complex_includes_things_nested_things
"links" => {
"self" => "http://test.host/api/things/40/relationships/things",
"related" => "http://test.host/api/things/40/things"
}
},
"data" => []
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lgebhardt I would like you to confirm something about this change.

@tommy-russoniello asked me why this would have changed but L4389 has another resource that did not change to include data. My explanation for this is that this resource is not a leaf in the things.things.things include, but the other one is, so we did the work of looking up the related things for this one, but not the other.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scottgonzalez I believe you are correct.

Copy link
Member

@lgebhardt lgebhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tommy-russoniello Thanks for cleaning this up.

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.

3 participants