So i\'d like to be able to add an external database to my config/database.yml
Then model one table from it.
Is this possible? I haven\'t been able to
First, define the connection information in database.yml:
my_external_db:
adapter: mysql
username: ...
....
Then, create the model and connect it to the external db
class MyExternalModel < ActiveRecord::Base
establish_connection(:my_external_db)
set_table_name 'my_external_table'
end
set_table_name
is removed, so instead, you should use: self.table_name