Created
March 26, 2010 07:46
-
-
Save sbusso/344645 to your computer and use it in GitHub Desktop.
This file contains 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
new_object = OtherDatabase::NewClass1.new | |
... | |
result = OtherDatabase::NewClass1.find(:all) |
This file contains 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
other_database_connection: | |
adapter: postgresql | |
encoding: utf8 | |
database: database_name | |
username: user | |
password: password | |
host: localhost |
This file contains 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
class External < ActiveRecord::Base | |
self.abstract_class = true | |
establish_connection :other_database_connection | |
end |
This file contains 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
This file contains 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
class OtherDatabase::NewClass1 < External | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment