In my Rails seeds file I sometimes have the need to destroy all records for a given model. This is extremely dangerous in production.
One key slip and you could potentially trash the entire database and then you'd need to restore from a backup. An entire morning wasted.
Here's a simple trick to only run destructive seed instructions in Development.
case Rails.env when 'development' Person.delete_all Address.delete_all Person.create(name: 'Sergio Tapia') end
No more botched seed runs.