Closed klobuczek closed 5 years ago
Huh, that's an interesting one. I think that basically we didn't think about it.
One question that I had initially is: does this just happen in self-referencing associations. But I can imagine a situation where it could happen with two models referring to each other in this way.
My first instinct when thinking of it as just one model was to say that you should only ever update the has_one
because I was thinking of ancestries in SQL where you have a parent_id
and that's the one authoritative place that exists. But I think the same could be said of has_one
/has_many
associations on a pair of different models. So overall only ever updating the has_one
is not reasonable.
Normally the origin
key doesn't do much aside from save you a bit of time and be a bit more declarative. But I could imagine that if you set up a pair of associations via origin
that the gem should probably take care of updating has_one
associations correctly to respect the has_one
Does not enforce the
has_one :parent
schema defintion.@cheerfulstoic Do you recall if this has been missed or intentionally not implemented due to e.g. complexity etc.
Additional information which could be helpful if relevant to your issue:
Code example (inline, gist, or repo)
Runtime information:
Neo4j database version:
neo4j
gem version:neo4j-core
gem version: