Skip to content
Browse files

nwrapper returns nodes, not relationships

  • Loading branch information...
1 parent f33c9ca commit 3176c15b29255759cb6526c4e44373876ce6f32e @lordkada committed Oct 29, 2011
Showing with 5 additions and 5 deletions.
  1. +3 −3 lib/neology/rels_mixin/n_wrapper.rb
  2. +2 −2 spec/relationship_spec.rb
View
6 lib/neology/rels_mixin/n_wrapper.rb
@@ -32,19 +32,19 @@ def size
def include? element
@inner_rels_array.each do |element|
- return element["self"].split('/').last.to_i == element.id
+ return element["end"].split('/').last.to_i == element.id
end
end
def each &block
@inner_rels_array.each do |rel|
- block.call Neology::Relationship._load(rel)
+ block.call Neology::Node.load(rel["end"].split('/').last.to_i)
end
end
def collect &block
@inner_rels_array.collect do |rel|
- block.call Neology::Relationship._load(rel)
+ block.call Neology::Node.load(rel["end"].split('/').last.to_i)
end
end
View
4 spec/relationship_spec.rb
@@ -78,8 +78,8 @@
userType.user<<user_b
userType.user.size.should == 2
- userType.user.collect do |rel|
- rel.end_node.id
+ userType.user.collect do |node|
+ node.id
end.should include(user_a.id, user_b.id)
user_a.del

0 comments on commit 3176c15

Please sign in to comment.
Something went wrong with that request. Please try again.