ecto_morph
ecto_morph copied to clipboard
Add a deeply nested put_change fun...
...so that we can put a change on a deeply nested changeset. We can use the same zipping idea from the validate_nested_changeset. We need to seperate out the recursion though so we can do different things when we get to where we need to be I should imagine.
In fact if we abstract the recursion we may well be able to enable more functions almost for free that operate on arbitrarily nested changes in the changeset. Did someone say recursion scheme.
The semantics of the recursion are probably -> go through changes - expect to be pointed to a changeset. apply the function to all *_manys if there are any.
We may have to think about what happens if a change isn' there. Like are we only validating the change if it's there... etc.
Stuff like that. If we get put_change then delete_change, fetch_change all seem possibilities. Ooo and merge. What about deep_merge. This is getting spicy. Actualy fuck it, exclusion_constraints would work with a path. Is this basically turning into a graph library? Are we changesets for trees? 🌲
I wonder if KeywordLens has a place here... 🤔