activegraph icon indicating copy to clipboard operation
activegraph copied to clipboard

has_many/has_one association leaves orphan nodes

Open lshimokawa opened this issue 5 years ago • 0 comments

Related to: https://github.com/neo4jrb/neo4j/issues/1548

Additional information which could be helpful if relevant to your issue:

Code example (inline, gist, or repo)

class Person
  include Neo4j::ActiveNode
  has_one :out, :parent, type: :parent, model_class: :Person
  has_many :in, :children, origin: :parent, model_class: :Person    
end

root = Person.create!(children: [p1=Person.create!, p2=Person.create!])
root.update(children: [p1])

image

image

Runtime information:

Neo4j database version: neo4j gem version: neo4j-core gem version:

lshimokawa avatar May 30 '19 21:05 lshimokawa