You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Question: Can relationship resources always have id and type? #94
Firstly, I'm not 100% sure if this is the right place as I'm new to the gem. If it's not correct them I'm happy to move it as required.
We found this gem and am very excited about using it due to the very impressive performance. We are currently using ActiveModelSerializers in our app and are looking to migrate away in favour of this gem. I have everything working with the exception of one thing:
We have an Ember front-end and the devs on that team have said that when Ember uses a jsonapi API, we should always have id and type in the data object of a relationship as Ember maintains a data cache and if they are missing Ember will assume that those entities are no longer present. This should be irrespective of if the relationship is included or not.
For example, if we have a resource that belongs_to an account and we don't include account we get this:
changed the title [-]Question: Should relationship resources always have `id` and `type`?[/-][+]Question: Can relationship resources always have `id` and `type`?[/+]on Dec 12, 2017
Activity
[-]Question: Should relationship resources always have `id` and `type`?[/-][+]Question: Can relationship resources always have `id` and `type`?[/+]beauby commentedon Dec 12, 2017
Hey, sure, simply do:
andypike commentedon Dec 12, 2017
Thank you! Works a treat! 💜