I’ve got a weird problem with loading fixtures, and I’m hoping someone
out there can help. I’m having problems running my tests, because for
one of my models the fixtures are loading strangely. Here’s an
This is a model that’s wrapping a legacy table. It has no id column.
However, its pidm column is the primary key, so in my model I’ve got:
alias_attribute :id, :pidm
If I load up my fixtures using “rake:fixtures:load RAILS_ENV=test”
then everything works just fine. My 5 fixtures for this model go in
to the test db exactly as written. However, when I run my test suite,
and rails loads the fixtures, 3 of the 5 fixtures load up with their
pidm field set to 91.
It’s surprising because it’s only 3 of the 5. I’ve been poking at it
all morning, with no luck. I’ve changed data values, etc., and it’s
always the same 3 that come out with 91. The other 2 fixtures have
the pidm that’s set in the fixture’s yaml file.
Has anybody encountered this? Or does anybody have suggestions?