I'm trying to connect to a Mysql database using MysqlAdapter, so I can
migrate some data from a system that is being replaced by a Rails
application. This requires having an open connection to two different
databases, one of which I will query directly, and the other being
used for the new application's models.
I started with ActiveRecord::Base.establish_connection to connect to
the previous apps database, but when I do that it changes the models
in my new application to attempt to use that database as well, making
it impossible to save the newly migrated data.
Can somebody give an example of how to create a standalone connection,
which isn't being tracked by ActiveRecord? I've tried
MysqlAdapter.new, but I have no idea what the parameters are meant to
be (despite several hours of running in circles through ActiveRecord's
internals), so I havn't been able to open a connection yet.