namxam/architect4r — Issue #7: relationships: incoming and outgoing are nil 
Author: mugwump
Created: 2011-12-06 20:40:05+00:00
State: open

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:

```ruby
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:

```ruby
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?!