Skip to content

Commit

Permalink
Fixed appending (<<) on incoming relationships [#80 state:resolved]
Browse files Browse the repository at this point in the history
node1.relationships.incoming(:friends) << node2 did not work as expeced
  • Loading branch information
andreas committed Oct 5, 2009
1 parent 49c9215 commit 3536a18
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/neo4j/relationships/relationship_traverser.rb
Expand Up @@ -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?
Expand Down
1 change: 0 additions & 1 deletion test/neo4j/relation_traverser_spec.rb
Expand Up @@ -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

Expand Down

0 comments on commit 3536a18

Please sign in to comment.