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

Metadata usage? #82

Closed
gautampunhani opened this issue Feb 26, 2013 · 2 comments
Closed

Metadata usage? #82

gautampunhani opened this issue Feb 26, 2013 · 2 comments

Comments

@gautampunhani
Copy link

I was trying to use metadata with my Her model. While the middlware segregates the response into data, errors and metadata, but on model initialization the parameters of metadata being send-in are parsed_data[:data] instead of parsed_data[:metadata].
Saw your comment
#16 (comment)

Was curious to know if it is something that has been done intentionally or is it some feature in-dev?

@remi
Copy link
Owner

remi commented Apr 3, 2013

Actually, that comment is not accurate anymore.

If your model data has a metadata key, it’s going to be parsed by the detault middleware (here) and passed to the initializer through the :_metadata special key (here). The initializer is going to keep it in the resource’s metadata accessor (here). Same thing goes for the errors key, which is stored in the response_errors accessor.

There was a typo in the find method though, so that currently only works in the master branch.

Hope that helps!

@remi
Copy link
Owner

remi commented Apr 5, 2013

I’m gonna close this issue now and hope that my last comment helped you solve it!

@remi remi closed this as completed Apr 5, 2013
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

2 participants