Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept node hashes in label methods #105

Merged
merged 2 commits into from
Aug 14, 2013

Conversation

sosiouxme
Copy link
Contributor

Currently, adding labels as you would expect to against Neo4J 2 is broken:

neo = Neography::Rest.new
node = neo.create_node({})
neo.add_label(node, "Person")
# =>    Neography::NeographyError: Neography::NeographyError
from /home/luke/.gem/gems/neography-1.1.1/lib/neography/connection.rb:195:in `raise_errors'
from /home/luke/.gem/gems/neography-1.1.1/lib/neography/connection.rb:171:in `handle_4xx_500_response'

I.e. nondescript error. Looking in the neography log is slightly helpful...

Error 405 Method Not Allowed
HTTP ERROR 405
Problem accessing /db/data/node/%7B%22extensions%22=%3E%7B%7D,%20%22labels%22=%3E%22[...]

Unlike most Neography methods, add_label and the like don't convert whatever they get to a node ID using get_id(). So, whatever you pass in gets sent off directly in the REST request... a bit surprising.

Modified logic and tests supplied.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 8f9af3e on sosiouxme:label-node-hashes into 5d4e2d0 on maxdemarzi:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 02295aa on sosiouxme:label-node-hashes into 5d4e2d0 on maxdemarzi:master.

@pboling pboling mentioned this pull request Aug 13, 2013
maxdemarzi added a commit that referenced this pull request Aug 14, 2013
Accept node hashes in label methods
@maxdemarzi maxdemarzi merged commit 40c1a0c into maxdemarzi:master Aug 14, 2013
@maxdemarzi
Copy link
Owner

Thanks!

@sosiouxme sosiouxme deleted the label-node-hashes branch August 17, 2013 15:17
willkessler pushed a commit to willkessler/neography that referenced this pull request Apr 21, 2014
Added editable options for strong params
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants