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

Add support for non-embedded associations #27

Open
travisp opened this issue Feb 26, 2015 · 2 comments
Open

Add support for non-embedded associations #27

travisp opened this issue Feb 26, 2015 · 2 comments

Comments

@travisp
Copy link

travisp commented Feb 26, 2015

Not everyone uses the "embed" functionality of ActiveModel::Serializers, and it would be nice if postgres_ext-serializers could support associations in this case (and in the meantime, print a warning or include information in the readme about this).

In theory, it shouldn't be too difficult, as it just requires a nested row_to_json (for has_one) or json_agg (for has_many) on the sub serializers query and the where clause. Much of the code for this already exists, but it's just focused on putting the embedded object in root rather than nested within other objects.

Would there be support for this extension of postgres_ext-serializers?

@danmcclain
Copy link
Contributor

I'm not sure I understand exactly what you are asking for. And postgres_ext-serializers so far only includes what I've needed to build for the things I was working on at the time. Very much open to any pull request that extends the functionality to support more cases

@felixbuenemann
Copy link
Collaborator

I'm not sure I understand what you are proposing. Could you maybe post the expected JSON?

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

3 participants