Change how renderer output is converted to JSON#1
Merged
malcolmbaig merged 3 commits intomasterfrom Sep 27, 2021
Merged
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.
duncanjbrown
left a comment
There was a problem hiding this comment.
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
Author
|
@duncanjbrown added some specs! |
gpeng
approved these changes
Sep 27, 2021
gpeng
left a comment
There was a problem hiding this comment.
- bonus points for naming the user Johnny Cache 🤣
+1 👏👏👏 |
|
@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? |
Author
|
@remear Sure! Raised a PR for the change here jsonapi-rb#133. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
datafield.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