CodeDredd / pinia-orm

The Pinia plugin to enable Object-Relational Mapping access to the Pinia Store.
https://pinia-orm.codedredd.de/
MIT License
444 stars 38 forks source link

fix(pinia-orm): Serialization was wrong with custom cast with custom serialization #1866

Closed Graphmaxer closed 3 months ago

Graphmaxer commented 3 months ago

🔗 Linked issue

Resolves https://github.com/CodeDredd/pinia-orm/issues/1864

📚 Description

When updating an existing entry in a repository, the casts are not applied if the value is a class object with custom serlize. Now $getAttributes() checks if an object has a custom serialize function which is then used.

Graphmaxer commented 3 months ago

The fix https://github.com/CodeDredd/pinia-orm/commit/4ecf93f43b2dcfb98864f7c791a3d70c8be58a99 for $dirty is not working with this change

CodeDredd commented 3 months ago

Yeah your change will break $isDirty() for updating hooks. I need to look into it and think about an solution. Going to check out your branch

codecov-commenter commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.76%. Comparing base (ed747cb) to head (52a8844). Report is 6 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1866 +/- ## ======================================= Coverage 99.76% 99.76% ======================================= Files 88 88 Lines 6032 6044 +12 Branches 512 515 +3 ======================================= + Hits 6018 6030 +12 Misses 12 12 Partials 2 2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.