Skip to content

Instantly share code, notes, and snippets.

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 December 30, 2010 11:24
old rails 2 rake task to dump db data into YAML files
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 November 10, 2010 00:24 — forked from zhengjia/gist:395021
rcov raketask for Rails 3, RSpec 2
# 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