Skip to content

Instantly share code, notes, and snippets.

@robdimarco
Created February 28, 2011 17:01
Show Gist options
  • Save robdimarco/847622 to your computer and use it in GitHub Desktop.
Save robdimarco/847622 to your computer and use it in GitHub Desktop.
Bootstrapping ActiveRecord from database.yml
require 'rubygems'
require 'active_record'
ActiveRecord::Base.establish_connection YAML.load(File.open(File.join(Rails.root, "config", "database.yml")))[Rails.env]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment