fix(related-data): use same reference on record for dataValues and direct attributes#574
Conversation
jeffladiray
left a comment
There was a problem hiding this comment.
Peer reviewed with Steve, but I think he will also add a few comments.
Manual tests on sequelize seems ok to me. Added a few comments/suggestion, but feature-wise it LGTM.
SteveBunlon
left a comment
There was a problem hiding this comment.
Looks good to me, I've tested it using mongoose (smart field + smart relationship).
I've written some comments but most of them are [OPINION] so skippable.
|
Code Climate has analyzed commit 4e7a54d and detected 1 issue on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 100.0% (56% is the threshold). This pull request will bring the total coverage in the repository to 51.4%. View more on Code Climate. |
## [7.8.9](v7.8.8...v7.8.9) (2020-12-08) ### Bug Fixes * **related-data:** use same reference on record for dataValues and direct attributes ([#574](#574)) ([c65588e](c65588e))
|
🎉 This PR is included in version 7.8.9 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [8.0.0-beta.5](v8.0.0-beta.4...v8.0.0-beta.5) (2020-12-08) ### Bug Fixes * **related-data:** use same reference on record for dataValues and direct attributes ([#574](#574)) ([c65588e](c65588e)) * **smart-action:** do not mutate hooks on schema generation ([#580](#580)) ([dd2aee3](dd2aee3)) * **smart-action:** widgetEdit should not be erased when change hook is triggered ([#579](#579)) ([1014ade](1014ade)) * **smart-actions:** error message details missing for hooks ([#582](#582)) ([d2edf35](d2edf35)) * **smart-actions:** reset value when not present in enums in hook response ([#584](#584)) ([0f57a46](0f57a46)) * **smart-actions:** use changedField instead of comparing values to trigger the correct change hook ([#583](#583)) ([54d536b](54d536b)) * record not found in hooks (recordsId replaced with recordIds) ([#578](#578)) ([ccf6a8f](ccf6a8f)) ### Features * **role-permissions:** support the new role ACL format ([#577](#577)) ([4aed30f](4aed30f))
|
🎉 This PR is included in version 8.0.0-beta.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Pull Request checklist:
For not dealing with too much modification, I choose to directly overwrite the magic accessor on a field if one of its smart field has the same name.
As we are in a serialization process, this will not introduce side effects.
Not using dataValues (which in sequelize allow to isolate a context without magic accessors) will make it works with forest-mongoose too.
Others options are: