Skip to content

relationships: incoming and outgoing are nil  #7

Description

@mugwump

Excuse if this is stupid and/or there is an obvious solution, I'm just starting with neo4j/architect4r: I'm trying to make a list of things using neo4j/architect4r. My model is roughly like this:

class List < Architect4r::Model::Node
end

class Thing < Architect4r::Model::Node 
end

class ContainsThing < Architect4r::Model::Relationship
 def list
   source
 end 

 def thing
  destination
 end
end

I then try to make a list with two things on it:

    list = List.new
    list.save

    thing1 = Thing.new
    thing1.save

    thing2 = Thing.new
    thing2.save

    listed1 = ContainsThing.new(list, thing1)
    listed1.save

    listed2 = ContainsThing.new(list, thing2)
    listed2.save

    list.should respond_to(:links)
    list.links.outgoing.should include listed1

list properly responds to links, but outgoing and incoming are both nil. When I examine the list-node in the neo4j it only has a model-type relationship to the List Root. But no ContainsThing-relationship that connects it to the thing. What am I doing wrong here?!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions