Skip to content

Instantly share code, notes, and snippets.

View semikolon's full-sized avatar

Fredrik Bränström semikolon

View GitHub Profile
namespace :spec do
namespace :db do
namespace :fixtures do
desc 'Create YAML spec fixtures from data in an existing database. Defaults to development database. Set RAILS_ENV to override. You can also set tables to dump with rake spec:db:fixtures:dump TABLES=posts,pages'
task :dump => :environment do
sql = "SELECT * FROM %s"
skip_tables = ["schema_info", "schema_migrations"]
ActiveRecord::Base.establish_connection(RAILS_ENV)