From 30a94ffd5a6bd35f7ed7aa58e5e84511d07336c1 Mon Sep 17 00:00:00 2001 From: Ben Guidarelli Date: Thu, 19 Dec 2013 10:00:43 -0500 Subject: [PATCH] fixes automatically quoting value in find_node_labels search --- lib/neography/rest/node_labels.rb | 2 +- lib/neography/rest/paths.rb | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/neography/rest/node_labels.rb b/lib/neography/rest/node_labels.rb index 27968eb..85ab331 100644 --- a/lib/neography/rest/node_labels.rb +++ b/lib/neography/rest/node_labels.rb @@ -7,7 +7,7 @@ class NodeLabels add_path :base, "/labels" add_path :node, "/node/:id/labels" add_path :nodes, "/label/:label/nodes" - add_path :find, "/label/:label/nodes?:property=%22:value%22" + add_path :find, "/label/:label/nodes?:property=:value" add_path :delete, "/node/:id/labels/:label" def initialize(connection) diff --git a/lib/neography/rest/paths.rb b/lib/neography/rest/paths.rb index b322542..622f6e0 100644 --- a/lib/neography/rest/paths.rb +++ b/lib/neography/rest/paths.rb @@ -23,7 +23,11 @@ def add_path(key, path) def build_path(path, attributes) path.gsub(/:([\w_]*)/) do - encode(attributes[$1.to_sym].to_s) + if $1.to_sym == :value and attributes[$1.to_sym].class == String + encode("%22"+attributes[$1.to_sym].to_s+"%22") + else + encode(attributes[$1.to_sym].to_s) + end end end