Skip to content

Save the meta from the last request #18

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

Merged
merged 2 commits into from
Oct 6, 2014

Conversation

dplummer
Copy link
Contributor

So that you can do:

# api server
render_response(user, meta: {message: 'user destroyed'})

# api client
user.destroy
flash[:notice] = user.last_request_meta['message']

@chingor13
Copy link
Collaborator

Should this go on the class method version too? Or only there?

Also, tests please.

@dplummer
Copy link
Contributor Author

dplummer commented Oct 3, 2014

Added tests. Any class method that has a response returns a response object, which has the meta on it. So I think that's good.

@dplummer dplummer force-pushed the save-last-request-meta branch from d562d22 to 1625dd8 Compare October 3, 2014 00:11
@dplummer
Copy link
Contributor Author

dplummer commented Oct 3, 2014

Rebased on master to resolve a merge conflict

chingor13 added a commit that referenced this pull request Oct 6, 2014
Save the meta from the last request
@chingor13 chingor13 merged commit 0a54fbd into JsonApiClient:master Oct 6, 2014
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