Establish an ActiveRecord connection with a YAML c
http://snippets.dzone.com/posts/show/6925rmu_db_config.yml
host: localhostdatabase: xxxxpassword: xxxx
require 'rubygems'require 'active_record'dbconfig = YAML::load(File.open('rmu_db_config.yml'))ActiveRecord::Base.establish_connection(dbconfig) class Member < ActiveRecord::Baseend p participant = Member.find(:all)
页:
[1]