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

Adds support for meta attribute #768

Merged
merged 1 commit into from
Jan 5, 2015
Merged

Adds support for meta attribute #768

merged 1 commit into from
Jan 5, 2015

Conversation

kurko
Copy link
Member

@kurko kurko commented Jan 5, 2015

Currently, 0.10.0.pre doesn't support meta option in render. This
way, there's no way to support features such as pagination. 0.9 had
this feature in place.

This adds support for it, as well as fixes small things in README.md.

This won't support meta in array responses because arrays don't have
keys, obviously. Also, the response should have a root key, otherwise
no meta will be included.

In some cases, for example using JsonApi, ArraySerializer will result in
a response with a root. In that case, meta will be included.

@kurko
Copy link
Member Author

kurko commented Jan 5, 2015

@guilleiguaran tested and working 😁


def include_meta(json)
puts "meta: #{meta.inspect}" if $debug
puts "root: #{root.inspect}" if $debug
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please delete the puts :)

Currently, 0.10.0.pre doesn't support `meta` option in `render`. This
way, there's no way to support features such as pagination. `0.9` had
this feature in place.

This adds support for it, as well as fixes small things in README.md.

This won't support `meta` in array responses because arrays don't have
keys, obviously. Also, the response should have a `root` key, otherwise
no `meta` will be included.

In some cases, for example using JsonApi, ArraySerializer will result in
a response with a `root`. In that case, `meta` will be included.
@kurko
Copy link
Member Author

kurko commented Jan 5, 2015

@guilleiguaran 👍

guilleiguaran added a commit that referenced this pull request Jan 5, 2015
Adds support for meta attribute
@guilleiguaran guilleiguaran merged commit 3a60633 into master Jan 5, 2015
@guilleiguaran guilleiguaran deleted the adds-meta branch January 5, 2015 05:10
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

Successfully merging this pull request may close these issues.

2 participants