Support creating polymorphic has-many relationships#1217
Closed
saravanak wants to merge 1 commit intoJSONAPI-Resources:release-0-9from
Closed
Support creating polymorphic has-many relationships#1217saravanak wants to merge 1 commit intoJSONAPI-Resources:release-0-9from
saravanak wants to merge 1 commit intoJSONAPI-Resources:release-0-9from
Conversation
Contributor
|
@saravanak thanks for the work! Are you going to fix the test failures though? |
12 tasks
Contributor
|
@saravanak Thanks for working on this. Your changes have been pushed to release-0-9 |
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.
Consider a resource which has a polymorphic has-many relation .
Existing behavior: While creating the payload for the has-many relation should have the base class name as the
typefield in therelationshipspost data.New behavior: Allows creating a resource which has a polymorphic has-many relation even with the subclass type.
Why: Because ember sends in the subclass
modelName(the instance'smodelName) while creating a resource of the said specifications.I have raised a PR against the
0-9branch as this is the stable branch and this version was working fine against our codebase (master had some errors which I did not spend time on investigating any further..)All Submissions:
Per https://github.com/cerebris/jsonapi-resources/blob/v0.9.3/lib/jsonapi/request_parser.rb#L489-L502, this issue is evident from the code, and I stumbled on it on my usecase.
New Feature Submissions:
Bug fixes and Changes to Core Features:
Test Plan:
Reviewer Checklist: