Review database seed scripts and remove use of FactoryBot
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
The following discussion from !206213 (merged) should be addressed:
-
@rutgerwessels started a discussion: (+1 comment) @leetickett-gitlab approved, but we should consider this a quick fix.
This development seed is using FactoryBot for creating database objects for development purposes. This means that if something changes in the factories, the seeding can break. The authors of FactoryBot recommend against using FactoryBot for seeding data. See https://thoughtbot.com/blog/factory_bot-for-seed-data
So this seed might break again if something changes in one of the factories.
Implementation Plan
- Find a seed script using FactoryBot (currently 11)
- Replace FactoryBot.create with direct model creation or leverage an existing service/mechanism
- Test seed script still works
Bonus/stretch goal...
Find a way to prevent more being introduced (a Rubocop rule, or Danger rule?)