Hacker News new | ask | show | jobs
by bdcravens 881 days ago
Wouldn't it be easier to do the same with FactoryBot? It'll similarly cascade creation of associated records.
1 comments

I 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.

I 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.