Closed camallen closed 10 years ago
That looks good to me.
We may not need this since ff23af61bfe62d81b028b6a0f9d9cad2e4636623 - added the owner_name attribute to User and UserGroup serializers. Perhaps we just don't expose the OwnerName relationship on the Namebale models to avoid this issue.
I do think it would be good to contribute back to RestpackSerialzer though.
So that commit is merged is it okay to close this?
Yeah - I don't think we need to expose the polymorphic owner_name relationship in our serialized models via RestPack.
If we do i'll reopen and fix it.
As the owner relationship is polymorphic and RestPack Serializer doesn't embed the resource class context the owner routes will be useless.
I've got a PR with RestPack serializer but haven't gotten around to implementing anyting there.
My plan is to introspect on the belongs_to association and if it's polymorphic then represent this link as a resource object (note the href override link), e.g.