diff --git a/lib/neo4j/relationships/relationship_traverser.rb b/lib/neo4j/relationships/relationship_traverser.rb index de9b0b3cf..9fc23df5a 100644 --- a/lib/neo4j/relationships/relationship_traverser.rb +++ b/lib/neo4j/relationships/relationship_traverser.rb @@ -56,7 +56,9 @@ def both(type = nil) # # :api: public def <<(other_node) - @node._create_relationship(@type.to_s, other_node) + source,target = @node, other_node + source,target = target,source if @direction == org.neo4j.api.core.Direction::INCOMING + source._create_relationship(@type.to_s, target) end def empty? diff --git a/test/neo4j/relation_traverser_spec.rb b/test/neo4j/relation_traverser_spec.rb index 90b25a940..bf54a43f2 100644 --- a/test/neo4j/relation_traverser_spec.rb +++ b/test/neo4j/relation_traverser_spec.rb @@ -43,7 +43,6 @@ describe 'n1.relationships.incoming(:foo) << n2' do it "should append n2 as incoming node to n1" do - pending "see lighthouse ticket 80, http://neo4j.lighthouseapp.com/projects/15548-neo4j/tickets/80-n1relationshipsincomingfoo-n2-does-not-work-as-expected" n1 = Neo4j::Node.new n2 = Neo4j::Node.new