Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Michael Grosser grosser

🎯
Focusing
View GitHub Profile
@julik
julik / transactional.rb
Created Nov 1, 2011
Transactional database in Minitest in 7 lines of code
View transactional.rb
module TransactionalTests
# See minitest doco - use_transactional_fixtures_but_in_ruby
# to use include this into your test case
def run(runner)
test_result = nil
ActiveRecord::Base.transaction { test_result = super; raise ActiveRecord::Rollback }
test_result
end
end
View gist:375825
ssbe@domU-12-31-39-02-3C-61:/srv/ssbe/core/current/db$ /opt/ruby-enterprise/bin/bundle install
Fetching source index from http://gemcutter.org/
Using rake (0.8.7) from system gems
Using activesupport (2.0.1) from bundler gems
Using actionpack (2.0.1) from bundler gems
Using actionmailer (2.0.1) from bundler gems
Using activerecord (2.0.1) from bundler gems
Using activeresource (2.0.1) from bundler gems
Using rails (2.0.1) from bundler gems
Using tzinfo (0.3.20) from bundler gems
@njvitto
njvitto / deploy.rake
Created Apr 11, 2010 — forked from RSpace/deploy.rake
Rakefile to deploy and rollback to Heroku in two different environments (staging and production) for the same app
View deploy.rake
#Deploy and rollback on Heroku in staging and production
task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU'
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU'
task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag]
task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on]