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

Support for active_model_serializers #227

Closed
jcf opened this issue Dec 11, 2012 · 3 comments
Closed

Support for active_model_serializers #227

jcf opened this issue Dec 11, 2012 · 3 comments

Comments

@jcf
Copy link

jcf commented Dec 11, 2012

Hi all,

I'm using Neo4j and need to serialise objects and associations for an HTTP API.

The way I do this with ActiveModel-compliant objects is to use active_model_serializers, which doesn't work out-of-the-box with Neo4j Rails.

To get the basic support I need I added the following to an initializer in my Rails app:

Neo4j::Rails::Model.send(:include, ActiveModel::SerializerSupport)
Neo4j::Rails::Relationships::NodesDSL.delegate(:active_model_serializer, to: :to_a)

This is something I'd normally add to the wiki of a project for others to find, but before doing so I wanted to get some feedback on where you think it would be appropriate, if at all.

@andreasronge
Copy link
Member

Looks good to me if all the RSpecs works. Maybe you can produce a pull request ?
Looks like it's part of rails/active model which means we don't need another third party dependencies ?

@andreasronge
Copy link
Member

@brancusi
Copy link

brancusi commented Apr 3, 2015

Hi,

I've tried to follow the steps listed but I think something has changed since this was outlined.

Is there a new solution for using the active_model_serializer gem?

Also, in general, is there a better approach to rendering json?

Thank you

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

No branches or pull requests

3 participants