2 ms·
Wouldn't it be easier to do the same with FactoryBot? It'll similarly cascade creation of associated records.
by bdcravens 3y ago
Wouldn't it be easier to do the same with FactoryBot? It'll similarly cascade creation of associated records.
- e12e 3y agoI don't enjoy documenting the graph in two places, first in models, then in factories. But yes, the pattern is essentially the same, just our example methods and Faker - without Factory Bot.
- bdcravens 3y agoI can understand that. I prefer keeping my models clean without environment-specific implementation details, which is why I've settled on the FactoryBot approach for testing, seeding, etc.