Skip to content

Instantly share code, notes, and snippets.

View Gemfile
source 'http://rubygems.org'
gem 'rails', '3.1.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'pg'
@alexdreher
alexdreher / fx.rake
Created Dec 30, 2010
old rails 2 rake task to dump db data into YAML files
View fx.rake
namespace :generate do
desc "Overwrite all fixture files with the contents of all existing tables"
task :all => :environment do
tables = ActiveRecord::Base.connection.tables
tables.each do |table_name|
if not table_name == "schema_migrations"
File.open("db/seed_fixtures/#{table_name}.yml", 'w') do |file|
data = ActiveRecord::Base.connection.select_all("SELECT * FROM #{table_name}")
rows = {}
@alexdreher
alexdreher / rcov.rake
Created Nov 10, 2010 — forked from zhengjia/gist:395021
rcov raketask for Rails 3, RSpec 2
View rcov.rake
# Forked to get it working with Rails 3 and RSpec 2
#
# From http://github.com/jaymcgavren
#
# Save this as rcov.rake in lib/tasks and use rcov:all =>
# to get accurate spec/feature coverage data
#
# Use rcov:rspec or rcov:cucumber
# to get non-aggregated coverage reports for rspec or cucumber separately