Skip to content

Instantly share code, notes, and snippets.

View aaronyo's full-sized avatar

Aaron Boyd aaronyo

  • Nomic
  • Bend, Oregon
View GitHub Profile
@wbailey
wbailey / databases.rake
Created February 11, 2011 08:58
ActiveRecord migrations outside of Rails
require 'yaml'
require 'logger'
require 'active_record'
namespace :db do
def create_database config
options = {:charset => 'utf8', :collation => 'utf8_unicode_ci'}
create_db = lambda do |config|
ActiveRecord::Base.establish_connection config.merge('database' => nil)