Skip to content

Instantly share code, notes, and snippets.

@8th-Light-Blog
Created June 28, 2011 13:42
Show Gist options
  • Save 8th-Light-Blog/1051156 to your computer and use it in GitHub Desktop.
Save 8th-Light-Blog/1051156 to your computer and use it in GitHub Desktop.
Blog Title: Sharing a Database Among Multiple Rails Applications
Author: Jim Suchy
Date: February 20th, 2007
/projects/my_lib
--> lib
--> spec
$: << File.dirname(__FILE__) + '/your_lib_path'
require 'rubygems'
require 'active_record'
ActiveRecord::Base.establish_connection(
:adapter => "postgresql",
:host => "localhost",
:username => "rails",
:password => "",
:database => "<db name>_test"
)
require File.expand_path(File.dirname(__FILE__) + '/my_lib/lib/file_a'
require File.expand_path(File.dirname(__FILE__) + '/my_lib/lib/file_b'
require File.expand_path(File.dirname(__FILE__) + '/my_lib/lib/file_c'
require File.expand_path(File.dirname(__FILE__) + '/my_lib/lib/file_d'
require File.expand_path(File.dirname(__FILE__) + '/my_lib/lib/file_e'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment