Skip to content

Instantly share code, notes, and snippets.

@craigw
Created February 23, 2010 11:40
Show Gist options
  • Save craigw/312091 to your computer and use it in GitHub Desktop.
Save craigw/312091 to your computer and use it in GitHub Desktop.
task :prevent_brainfart_apocalypse do
raise "You're running in production" if Rails.env.production?
end
protect_me_from_myself_tasks = %W(db:setup)
protect_me_from_myself_tasks.each do |task_name|
Rake::Task[task_name].prerequisites << 'prevent_brainfart_apocalypse'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment