Conversation
JoBalk
force-pushed
the
20260821_jb_round-trip-write-path
branch
from
August 24, 2026 06:05
dfb29ea to
b4ff5fd
Compare
Whatever key to_hash emits is now assignable: a static as: aliases the setter, a dynamic as: resolves in a second pass over the keys the setters rejected. Fixed while building it: - nested dynamic aliases were skipped when the container used as: - assign_hash left a stale tail when shrinking a collection - dynamic_aliases sat below private despite being documented as public - sync wrote model.<alias> while to_object, from_object and on: read model.<declared name>, so an aliased twin could not round-trip through a model Documents round-tripping in USAGE.md, adds bin/console for exercising the working tree.
JoBalk
force-pushed
the
20260821_jb_round-trip-write-path
branch
from
August 24, 2026 06:06
b4ff5fd to
1cb0738
Compare
webit-schwarzer
left a comment
Collaborator
There was a problem hiding this comment.
Ich hab mich erstmal auf die README konzentriert, den Rest nur überflogen. Lass uns hier nochmal drüber reden.
Comment on lines
+179
to
+182
| On the model side the alias is the name too: `sync` and `to_object` write | ||
| `model.token=`, and `from_object`, `from_objects` and `on:` read `model.token`, | ||
| each falling back to the declared name when the model does not carry the alias. | ||
| That makes `as:` the way to map a property onto a differently named attribute: |
Collaborator
There was a problem hiding this comment.
Hier hab ich gleich zweimal Bauchschmerzen:
- Auf der Model-Ebene hätte ich als Gem-Nutzer die Umbenennung nicht erwartet. Serialisierung ist in Ordnung - aber falls ich mein Model drunter hab, sollte das übereinstimmen. Andernfalls könnte man die Frage stellen, warum es überhaupt zwei Namen gibt, wenn doch in jedem Fall nur der eine verwendet wird.
- Der Fallback ist nicht intuitiv. Das würde ich als Gem-Nutzer ebenfalls nicht erwarten. Das fühlt sich wie "raten" an. Ich befürchte, dass uns das auf lange Sicht mehr Probleme macht als es löst.
Comment on lines
+193
to
+194
| A dynamic `as:` is skipped here — a name computed per instance cannot address a | ||
| fixed attribute — so those properties always use the declared name. |
Collaborator
There was a problem hiding this comment.
Den Satz versteh ich nicht. Stammt der aus einem Arbeitsstand zwischendurch?
| occurredAt: "2026-08-21T09:00:00Z", | ||
| fieldName: "score", | ||
| fieldValue: 42, | ||
| labels: ["urgent", "vip"], |
Collaborator
There was a problem hiding this comment.
s.o.
Das scheint mir nicht konsistent. Hier müsste nach meinem Verständnis tags stehen, damit das wieder auf die labels Collection deserialisiert wird. Hier greift doch das o.g. "Raten" bzw. "Probieren". Oder sehe ich das falsch?
Collaborator
Author
|
Roland is right, this is overkill |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[FEATURE] Accept serialized keys on the write path
Whatever key to_hash emits is now assignable: a static as: aliases the
setter, a dynamic as: resolves in a second pass over the keys the setters
rejected.
Fixed while building it:
model., so an aliased twin could not round-trip through
a model
Documents round-tripping in USAGE.md, adds bin/console for exercising the
working tree.