-
Notifications
You must be signed in to change notification settings - Fork 0
Change how renderer output is converted to JSON #1
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
Conversation
Update the railtie to fix issues with the way renderer output is converted into a JSON string in the controller. Cached and non-cached resources need slightly different handling, so make a logical check to tell the difference and use the appropriate method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent comment! 👏
Can we prove this in a spec?
These specs test the caching version of the render call more thoroughly. - Assert that the expected data structure is stored in the cache - Assert that the response is the same whether using the caching version of this call or the regular one
- Git ignore tmp cache files - Add pry-byebug to dev dependencies
@duncanjbrown added some specs! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- bonus points for naming the user Johnny Cache 🤣
+1 👏👏👏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 👍 👍
@malcolmbaig Fantastic work on this! I just encountered some of these issues while picking up some long-overdue maintenance work on jsonapi-rb. Would you mind if I merge these changes upstream? |
@remear Sure! Raised a PR for the change here jsonapi-rb#133. |
Context
data
field.Changes proposed in this pull request
Update the railtie to fix issues with the way renderer output is
converted into a JSON string in the controller.
Cached and non-cached resources need slightly different handling, so
make a logical check to tell the difference and use the appropriate
method.
Guidance to review
Link to Trello card
https://trello.com/c/lvTXTofp