Seeds...of Destruction! 🌱 ➡️ 💥
07-Mar-2025 33
Maybe you trust your db/seeds.rb file to be idempotent when you run bin/rails db:seed, and maybe you don’t, but either way, you should test it so you can be sure that it does what you think it does.
Doing so is simple! Let’s run through the process.
Here’s a sample seed file:
We want it to create users or update them if they already exist
We want it to create blog posts or return them unchanged if they already exist.
Seeds...of Destruction! 🌱 ➡️ 💥 #ruby #rubydeveloper #rubyonrails #Seeds...of #Destruction! https://rubyonrails.ba/link/seeds-of-destruction