I have a problem with the hash method from ruby:
http://apidock.com/ruby/v1_8_7_330/Hash/hash
I use this to compare two different objects with the same content in order to find a collision between the database objects and the new elements with the same attributes.
It worked, apparently, for a long time (more than one year), but it suddenly stopped working on my development computer.
If I try this in the rails console:
a = {:a => 'a', :b=>'b'}
b = {:a => 'a', :b=>'b'}
a.hash
b.hash
I get the same value for a.hash and b.hash ( -3820017043059270405) in the same console. The problem is that if I switch to another console, it returns a different value from the first console ( -1865824882785682267).
Shouldn't the same hash ever be returned ?
Thanks in advance.
: - 1.8.7.