Newer versions of Rails has a nice feature where you can use label references for fixtures. So instead of:
1 2 3 4 |
|
You can do this:
1 2 3 |
|
However, if your model class name is in a pluralized form, you might find that label references won’t work. That’s because fixtures derive their class name from the singular form of the table name by default. Fortunately, you can fix this by adding this line to your TestHelper:
1 2 3 4 5 |
|
Hopefully, this will save someone else from having to dig through the Rails fixtures internals.