Skip to content

Instantly share code, notes, and snippets.

View aaronchi's full-sized avatar

Aaron Eisenberger aaronchi

  • Santa Monica, CA
View GitHub Profile
namespace :db do
# Prevent dropping Production DB
# ... or terminate postgres connections before attempting to drop in non production environment
task :drop => [:abort_in_production, :terminate_pg]
task :abort_in_production => :environment do
abort "Can't drop #{Rails.env} DB!" if Rails.env.production?
end