Skip to content

Instantly share code, notes, and snippets.

@sameera207
Created June 29, 2012 08:07
Show Gist options
  • Save sameera207/3016589 to your computer and use it in GitHub Desktop.
Save sameera207/3016589 to your computer and use it in GitHub Desktop.
base class for connecting multiple databases with pure ruby
require 'rubygems'
require 'active_record'
class <ClassName> < ActiveRecord::Base
self.establish_connection(
:adapter => 'mysql',
:database => 'database_name',
:username => 'password'
)
self.abstract_class = true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment