Skip to content

Instantly share code, notes, and snippets.

@qichunren
Created December 20, 2011 10:30
Show Gist options
  • Save qichunren/1501107 to your computer and use it in GitHub Desktop.
Save qichunren/1501107 to your computer and use it in GitHub Desktop.
mutil database connection in rails
# encoding: utf-8
class DbConnections
def self.set_connection(db)
Post.establish_connection({
:adapter => "sqlite3",
:database => "db/development_#{db}.sqlite3",
:pool => 5,
:timeout => 5000
})
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment