How can I use FactoryBot in db/seeds?
All you need to do is add require 'factory_bot_rails'
to the db/seeds.rb
file. This will give you access to your factories.
Note: Gem was previously called FactoryGirlRails
Josh Clayton, the maintainer of FactoryGirl, recommends against using FactoryGirl in your seeds file. He suggests using plain ActiveRecord instead.