-
What happens when a model gets updated? It seems that Fridge fails to unfreeze existing data into a new structure. I see two cases here:
One idea is to catch errors on load and then try to import data by first loading them into a generic dictionary/map (whatever is available on swift) and then manually importing data into the new, extended structure. This process could also give a mapping callback that could be used in case of modified fields (e.g. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
Unfortunately, Fridge fails to unfreeze a model that gets changed meanwhile. Reason for this unwanted behavior is internals of the freezing sub-system (file storage). As this may lead to extra responsibility of the storage layer and increase complexity - which is tried to be avoided by "moving" these tasks to a upper layers - this is known limitation. However, this may be sort of workaround solution:
Eventually, this may be wrapped into standalone function, named eg. |
Beta Was this translation helpful? Give feedback.
-
As long as I think about this, it becomes more and more important :) An update of the model is something that often happens with production code. So I am thinking about the following (similar to e.g. flybase):
In short, it would be great if we can have some kind of load/save method that uses a generic collection. |
Beta Was this translation helpful? Give feedback.
Unfortunately, Fridge fails to unfreeze a model that gets changed meanwhile. Reason for this unwanted behavior is internals of the freezing sub-system (file storage).
As this may lead to extra responsibility of the storage layer and increase complexity - which is tried to be avoided by "moving" these tasks to a upper layers - this is known limitation.
However, this may be sort of workaround solution:
drop
original modelfreeze
it againEventually, this may be wrapped into standalone function, named eg.
swap(..)
?