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

NoMethodError (undefined method `body=' for CypherNode 2093 (69983648512020):Neo4j::Server::CypherNode): #943

Closed
djvs opened this issue Aug 26, 2015 · 11 comments

Comments

@djvs
Copy link

djvs commented Aug 26, 2015

After:

 q = @res.questionbyid(params[:id])

[...]

 def questionbyid(id)
     self.query_as(:a).match('a-[r:aquestions]-n').where(n: {uuid: id}).pluck(:n).first
 end
@djvs
Copy link
Author

djvs commented Aug 26, 2015

Also a possibly related error (???) -

  TypeError (no implicit conversion of Symbol into Integer):
    app/models/resource.rb:968:in `block in as_json'
    app/models/resource.rb:968:in `map'
    app/models/resource.rb:968:in `as_json'

Possibly another class mismatch?

@subvertallchris
Copy link
Contributor

You're getting a CypherNode because it's having trouble finding the mode
that's responsible for that combination of labels. Weird. If you call
:wrapper on the CypherNode, what does it return?

On Tuesday, August 25, 2015, djvs [email protected] wrote:

Also a possibly related error (???) -

TypeError (no implicit conversion of Symbol into Integer):
app/models/resource.rb:968:in block in as_json' app/models/resource.rb:968:inmap'
app/models/resource.rb:968:in `as_json'

Possibly another class mismatch?


Reply to this email directly or view it on GitHub
#943 (comment).

@djvs
Copy link
Author

djvs commented Aug 26, 2015

Might have been an error in my code (commas left over from a hash...) testing...

@djvs
Copy link
Author

djvs commented Aug 26, 2015

Hmm yes...so I guess if you define a model's attribute to be the model itself... or possibly some hash... it will cause that...

@subvertallchris
Copy link
Contributor

Can you elaborate and give an example?

On Tuesday, August 25, 2015, djvs [email protected] wrote:

Hmm yes...so I guess if you define a model's attribute to be the model
itself... or possibly some hash... it will cause that...


Reply to this email directly or view it on GitHub
#943 (comment).

@djvs
Copy link
Author

djvs commented Aug 26, 2015

Well, I closed the file now, but it looked something like this:

q.explanation = params[:explanation],
q.version = 0,
q.answers = answers
q.save

This would mess something up, then the next time the whole Rails action was called (I think), it would give the CypherNode error. Removing the commas makes the problem vanish.

@djvs
Copy link
Author

djvs commented Aug 26, 2015

I take that back. It's still doing it.

@djvs
Copy link
Author

djvs commented Aug 26, 2015

puts q.wrapper.inspect gives:

 CypherNode 2170 (69979787324900)

Restarting the server resolves the bug...

@djvs
Copy link
Author

djvs commented Aug 26, 2015

Yes, the two bugs I reported are related. This:

obj[:questions] = self.questions.map{|x|puts x.inspect + " XXX"; x.as_json("teacher")}

Will give this:

CypherNode 2093 (70028474526840) XXX
Completed 500 Internal Server Error in 19ms

TypeError (no implicit conversion of Symbol into Integer):

@subvertallchris
Copy link
Contributor

I just released 5.1.5 to fix this.

@subvertallchris
Copy link
Contributor

You can reopen this issue and/or ping me on Gitter if you're still having trouble.

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

No branches or pull requests

2 participants