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

Rails model objects do not compare with '==' under jRuby 1.7.1 #225

Closed
ayqazi opened this issue Dec 8, 2012 · 2 comments
Closed

Rails model objects do not compare with '==' under jRuby 1.7.1 #225

ayqazi opened this issue Dec 8, 2012 · 2 comments

Comments

@ayqazi
Copy link

ayqazi commented Dec 8, 2012

Hello,

This is a weird problem - I don't know if it's related to neo4j or jRuby, but I thought I'd mention it here. Using neo4j.rb 2.2.0 and jRuby 1.7.1, I found that comparing 2 objects that represent the same node return false when comparing with '=='. However, when I switch to the old version of jRuby I was using, jRuby 1.6.7.2, it works. I am running jRuby 1.6.7.2 in 1.9 mode with --1.9.

Basically, I was just doing a 'Person.first == Person.first', and it was true under 1.6.7.2, and false under 1.7.1 .

Any idea what's up? jRuby 1.6.7.2 emulates Ruby 1.9.2, wherever jRuby 1.7.1 emulates Ruby 1.9.3. Could that be the problem?

I'm switching back to jRuby 1.6 for now, as comparing 2 different objects that represent the same node in the graph DB and getting a return value of 'true' just seems the right thing to do.

Thanks

@andreasronge
Copy link
Member

Hmm, really strange.
The implementation is here:
https://github.com/andreasronge/neo4j-core/blob/master/lib/neo4j-core/equal/equal.rb
The above mixin is used to extend the Neo4j Node/Relationship Java classes

The Neo4j Rails models delegates to the Java Node and Relationship objects
see https://github.com/andreasronge/neo4j-wrapper/blob/master/lib/neo4j-wrapper/node_mixin/delegates.rb

Not sure when I will have to time to investigate this more. But I'm curious ...

@ayqazi
Copy link
Author

ayqazi commented Dec 17, 2012

Thanks so much for fixing that

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