I'm having an issue where the auto generated IDs in the fixtures are
inconsistent from my machine to that of the other developers working
on the project. The main difference between between the machines is
that I'm running Snow Leopard and I think everyone else is on
Leopard.
We're using factories to generate the fixtures so I don't know what
label Rails is hashing to auto generate the ID.
Any help in debugging this would be greatly appreciated. Thanks in
advance.
Sorry, I just got my hands on this code for the first time a few days
ago so I'm just learning it.
To give you an example:
The yml for the BlogPost factory contains a hardcoded author_id. That
author_id is one that is apparently being auto generated by the Author
factory and for the original team that's consistently working.
Unfortunately, for myself, the ids being auto generated for the Author
objects don't include the id hardcoded into the BlogPost factotry.
In previous versions of rails the autogenerated fixture is (basically)
just the hash of the label (as in "foo".hash).
The hash method is not guaranteed to be the same across different
versions or builds of ruby, in particular 64 bit versions are
different to 32bit (and in snow leopard ruby is a 64 bit app). Later
versions of rails (don't remember the first) use a crc32, so that
should be stable across different builds of ruby
I realize that, unfortunately I didn't write the tests and fixtures. I
was just hoping there was a way I could get them to pass before I go
through and change them.