From e851d5f5d0b0457b8812b79ce2363ea18506044b Mon Sep 17 00:00:00 2001 From: Javad Karabi Date: Thu, 28 Nov 2013 16:58:05 -0600 Subject: [PATCH] pass properties to unique relationship creation --- lib/neography/rest.rb | 4 ++-- lib/neography/rest/relationship_indexes.rb | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/neography/rest.rb b/lib/neography/rest.rb index 1886d53..4ed60f8 100644 --- a/lib/neography/rest.rb +++ b/lib/neography/rest.rb @@ -347,8 +347,8 @@ def create_relationship_auto_index(type = "exact", provider = "lucene") @relationship_indexes.create_auto(type, provider) end - def create_unique_relationship(index, key, value, type, from, to) - @relationship_indexes.create_unique(index, key, value, type, from, to) + def create_unique_relationship(index, key, value, type, from, to, props) + @relationship_indexes.create_unique(index, key, value, type, from, to, props) end def add_relationship_to_index(index, key, value, id) diff --git a/lib/neography/rest/relationship_indexes.rb b/lib/neography/rest/relationship_indexes.rb index b0a2aa6..7d0fb4a 100644 --- a/lib/neography/rest/relationship_indexes.rb +++ b/lib/neography/rest/relationship_indexes.rb @@ -17,13 +17,14 @@ def initialize(connection) super(connection, :relationship) end - def create_unique(index, key, value, type, from, to) + def create_unique(index, key, value, type, from, to, props) body = { :key => key, :value => value, :type => type, :start => @connection.configuration + "/node/#{get_id(from)}", - :end => @connection.configuration + "/node/#{get_id(to)}" + :end => @connection.configuration + "/node/#{get_id(to)}", + :properties => props } options = { :body => body.to_json, :headers => json_content_type }