From 80c863df1ede8a5094349d327f41b10cba0ed569 Mon Sep 17 00:00:00 2001 From: Javad Karabi Date: Thu, 28 Nov 2013 16:18:02 -0600 Subject: [PATCH] allow for Neography::Relationship.create_unique --- lib/neography/relationship.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/neography/relationship.rb b/lib/neography/relationship.rb index 383fac4..3f4f3a9 100644 --- a/lib/neography/relationship.rb +++ b/lib/neography/relationship.rb @@ -16,6 +16,14 @@ def create(type, from_node, to_node, props = nil) rel end + def create_unique(index, key, value, type, from_node, to_node, props = nil) + rel = Neography::Relationship.new(from_node.neo_server.create_unique_relationship(index, key, value, type, from_node, to_node, props)) + rel.start_node = from_node + rel.end_node = to_node + rel.rel_type = type + rel + end + def load(rel, db = Neography::Rest.new) raise ArgumentError.new("syntax deprecated") if rel.is_a?(Neography::Rest)