Add JSON Support - #83
Conversation
c2f4eff to
1d6b29dCompareCodecov Report
@@ Coverage Diff @@## master #83 +/- ##
=============================================
- Coverage 98.31% 82.06% -16.26% - Complexity 47 56 +9
=============================================
Files 3 4 +1 Lines 119 145 +26 =============================================
+ Hits 117 119 +2 - Misses 2 26 +24
Continue to review full report at Codecov.
|
lsmith77
commented
May 28, 2021
@nonoesp any feedback here? thx |
nonoesp
commented
May 28, 2021
Hey, @lsmith77 — I'll try to take a look at this soon (and hopefully test it). Thanks for the work! |
nonoesp
commented
Jun 15, 2021
Hi, @lsmith77 - I have little time to review and test this. I'd really appreciate if you could describe the steps I should follow to test this pull request and verify everything works? 🙏 |
lsmith77
commented
Jun 18, 2021
I stilll owe this PR tests. but fundamentally you have to make sure |
lsmith77
commented
Jun 23, 2021
I would appreciate advice on how to best test this. f.e. should I use |
lsmith77
commented
Jul 1, 2021
I am also wondering if instead or in addition to the command, there should be a migration? |
| $versionedHiddenFields = $this->versionedHiddenFields ?? []; | ||
| $this->makeVisible($versionedHiddenFields); | ||
| $version->model_data = serialize($this->attributesToArray()); | ||
| $version->model_data = $this->getEncoding() ? json_encode($this->attributesToArray()) : serialize($this->attributesToArray()); |
There was a problem hiding this comment.
Hey! Shouldn't this be $version->model_data = $this->getEncoding() == 'json' ? json_encode($this->attributesToArray()) : serialize($this->attributesToArray());?
There was a problem hiding this comment.
indeed! .. goes to show that this PR needs tests
There was a problem hiding this comment.
Yes, it does! I was testing manually yesterday and it doesn't seem to quite work with my site.
lsmith77
commented
Jul 19, 2021
@nonoesp I think I fixed the bug you encountered, however still didn't have time to figure out how to add tests and generate an efficient migration script. hopefully this week I will manage to do it. |
8c29cd1 to
599fa0cComparelsmith77
commented
Jul 25, 2021
@nonoesp I hope this is now ready to be merged. I added a very simple test case and also documented the process to create a migration with lazy loading (which however requires laravel 8). |
nonoesp
commented
Aug 5, 2021
Hi, @lsmith77 - I'll be taking a look at this! |
lsmith77
commented
Sep 8, 2021
ping? |
nonoesp
commented
Sep 13, 2021
Thanks for the reminder! |
nonoesp
commented
Dec 16, 2021
Hi @lsmith77 can you resolve the conflicts? |
lsmith77
commented
Dec 16, 2021
done |
fix for #82
note I am not so expierienced with developing for laravel .. it seems to work ok on a quick check.
I need to add tests. aside from this there are some "taste" things to decide .. like using the ternary syntax inside the Version class or if the call to config() should be "cached" in case multiple versionable models are handled in one request.