Created
February 10, 2009 18:28
-
-
Save pol/61519 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ::: in your database.yml | |
| # stuff common to several databases | |
| login: &login | |
| adapter: mysql | |
| username: fad | |
| password: fad | |
| host: localhost | |
| fad_2007: | |
| <<: *login | |
| database: fad_2007 | |
| development: | |
| <<: *login | |
| database: fad_development | |
| test: | |
| <<: *login | |
| database: fad2_test | |
| production: | |
| <<: *login | |
| database: fad2_production | |
| # Exernal Database Connection, through SSL | |
| grumpy: | |
| adapter: mysql | |
| host: grumpy.msu.montana.edu | |
| username: some_username | |
| password: a_delicious_password | |
| database: external_datbase_name | |
| sslca: /Users/mongrel/SSL/ca-cert.pem | |
| sslkey: /Users/mongrel/SSL/client-key.pem | |
| sslcert: /Users/mongrel/SSL/client-cert.pem | |
| ::: Then in your Model | |
| class UdarCourse < ActiveRecord::Base | |
| establish_connection :grumpy | |
| # for some reason, setting table names explicitly on external connections | |
| # resolved problems I was having. | |
| set_table_name "udar_courses" | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment