RestPack/restpack_serializer — pull request #81 by camallen (2014-07-15 16:23:45+00:00)
Title: resource links on a  polymorphic belongs_to association

I wanted to start a discussion around how to handle a polymorphic belongs_to relation on a resource.

Just returning the FK id doesn't contain the polymorphic context of the linked resource, resulting in an ambiguous link. I've implemented a simple fix that fits my needs as my polymorphic association target overrides the to_param method however if the association target doesn't then this problem still remains.

Perhaps there is a better way of embedding the association type in the links hash? Thoughts?