I’ve just hit a snag, and I’m hoping somebody out there can help.
I’m working on an app that uses some legacy tables. One of them doesn’t
have a column named “id” so I’ve got the following:
alias_attribute :id, :pidm
When I’m testing, I need 5 student fixtures. I have them defined like
When I load the fixtures into my test database with “rake
db:fixtures:load RAILS_ENV=test” everything works great. However, when
I run my test suite, and rails loads the fixtures, I get a big problem:
three of the fixtures aren’t loading with their pidm (id) correctly.
All three load with a pidm of 91, which is problematic since it breaks
any associations involving that primary key.
The two other fixtures load ok, though, which makes me very confused.
I’ve played around with the data differences between the fixtures, and
futzing the non-pidm data doesn’t seem to do anything.
Has anybody encountered this? Any advice?