This project is archived and is in readonly mode.
Fixture ID and String#hash in 1.9.1
Reported by August Lilleaas | March 4th, 2009 @ 01:44 PM | in 3.x
An example from my terminal:
It seems like the output of String#hash
varies from
process to process. This means that the ID that the foxy fixtures
generates (which uses String#hash on the fixture key name) are only
dependable per test run, not across multiple runs.
I wish I could provide a patch or suggest a solution, but after some sparse investigation I haven't found anything about changes to String#hash in 1.9.1.
This is only a problem when you refer to the IDs generated by
the foxy fixtures, which you rarely do anyways. I discovered this
in an app where I refer to some IDs in a config/settings.yml, and
because I use fixture data via rake db:fixtures:load
when developing, refering to these IDs are not reliable on 1.9
because they will change the next time I run rake
db:fixtures:load
.
Comments and changes to this ticket
-
August Lilleaas March 4th, 2009 @ 02:12 PM
Take a look at this pastie:
As you can see, the implementation of String#hash has changed significantly since 1.8, and is indeed different in every process, because of the random number seeding that occurs in rb_memhash.
-
Rohit Arondekar October 7th, 2010 @ 07:20 AM
- State changed from new to invalid
- Importance changed from to Low
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>