fix: allow multiple resource relation retrieval methods#1425
Merged
fix: allow multiple resource relation retrieval methods#1425
Conversation
Collaborator
Author
|
@lgebhardt oh, cool, it's green. Shouldn't be too hard to add a failing test which this makes pass when I'm next at my computer |
93cea02 to
b4905b4
Compare
bf4
commented
Jan 17, 2024
| # frozen_string_literal: true | ||
|
|
||
| module JSONAPI | ||
| module RelationRetrieval |
Collaborator
Author
There was a problem hiding this comment.
ideally, I think, this defines the required abstract interface, I think, required for a valid strategy
lgebhardt
approved these changes
Jan 17, 2024
Contributor
lgebhardt
left a comment
There was a problem hiding this comment.
Thanks! This looks good.
lgebhardt
added a commit
that referenced
this pull request
Apr 18, 2024
* fix: check if relation retrieval in included via included_modules * require 'jsonapi/relation_retrieval' * feat: raise when cannot include different retrieval strategy * test: multiple retrieval strategies --------- Co-authored-by: lgebhardt <larry@cerebris.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was named from my experience that it wasn't letting me have a JSONAPI::Resource with the default retrieval method and also create another resource using the mixin with a different retrieval method.
While working on it, I realized it was possible to apply multiple different retrieval methods. If it's the same, it warns you, which I think is fine, but the new thing is that if it's different, it raises, since I can't imagine anything good could come from intentionally saying 'using v10' but it's already 'v09' and not knowing that 'v09' wasn't included
I saw some slightly different behavior in the JSONAPI::Resource vs. all manual includes so I'll try that in our app and see if it works by 100% avoiding JSONAPI::Resource
New Feature Submissions:
Bug fixes and Changes to Core Features:
Test Plan:
Reviewer Checklist: