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

embedding ids in 0.10.x #1053

Closed
dbwieland18 opened this issue Aug 13, 2015 · 5 comments
Closed

embedding ids in 0.10.x #1053

dbwieland18 opened this issue Aug 13, 2015 · 5 comments

Comments

@dbwieland18
Copy link

I've come across a few issues that have started the discussion about including support for side-loading associations in 0.10.x, but with that still somewhere down the pipeline, I'm wondering if anyone has gone through the process of re-implementing the 'old' (not json-api) formatting that previous versions of AMS allowed for through use of

embed :ids, include: true

... need to stay on master for caching support, but I'm stuck on where to get started on re-implementing this feature.

@joaomdmoura
Copy link
Member

@dbwieland18 I think you can use the include option that we have on 0.10.x.

render @posts, include: ['authors', 'comments']

You can also use . in order to chain associations

render @posts, include: ['author', 'author.bio', 'comments']

We still have embed but only when declaring a association on a serializer:

has_many :comments, embed: :ids

I'm not sure if this solves your problem, just let me know 😄

@ksaveras
Copy link

ksaveras commented Jun 1, 2016

Anyway this does not work.

@NullVoxPopuli
Copy link
Contributor

what adapter are you using?

@ksaveras
Copy link

ksaveras commented Jun 1, 2016

Tried latest 0.10 version.
adapter Redis, ruby 2.2.4, OS windows 10 x64, rails 4.2.6
have articles and topics relation many to many
defined in articles serializer has_many :topics, embed: :ids, include: true
changed to version ~0.9.5 and worked fine, but not with 0.10

@remear
Copy link
Member

remear commented Jun 1, 2016

Redis is not an AMS adapter. This issue has been closed for a long time. Please open a new issue and provide the information requested by the issue template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants