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

Rebase/274 Add support for creating resources with polymorphic has one. #288

Merged
merged 8 commits into from
Jul 5, 2015

Conversation

lgebhardt
Copy link
Member

This is a rebase of #274.

@barelyknown @ggordon please review to make sure I didn't miss something.

I also removed the code that wasn't being covered by the tests. If you could check that out and make sure it won't affect things in your code that would be great. If we do need it in there we should make sure we test it.

ggordon and others added 7 commits July 5, 2015 08:38
This adds support for the serialization of `has_many` relationships. I'm not sure if it handles every situation that people are imagining but it addresses the primary issue that I saw which was the need to return the correct type for the individual resources. As with the solution for polymorphic `has_one` relationships, you need to add a `Resource` and `Controller` class for each potential type. I didn't address anything new related to creating or updating `has_many` relationships in this commit.
  `foreign_key_value` is only called for has one associations for now.
@barelyknown
Copy link
Collaborator

I just tested on a ~large app that depends on the polymorphic functionality and the tests passed. I also reviewed the two methods that you removed and that's fine. They aren't used.

lgebhardt added a commit that referenced this pull request Jul 5, 2015
Rebase/274 Add support for creating resources with polymorphic has one.
@lgebhardt lgebhardt merged commit 8ad3491 into master Jul 5, 2015
@lgebhardt lgebhardt deleted the rebase/274 branch July 5, 2015 14:33
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.

None yet

3 participants