You have to be a little careful with this, for sure, however it is not
difficult as long as you keep in mind which models belong where.
This is a decent article on how to do this:
Do note that AR classes which redefine database connections can be
subclassed and keep the super-class’s db connection. Thus:
class MySQLConn < ActiveRecord::Base
class SQLServerConn < ActiveRecord::Base
class Model1 < MySQLConn
… does stuff to mysql
class Model2 < SQLServerConn
… does stuff to sqlserver
You’ll have to go searching around and give some thought into dealing
test fixtures with this. There are a few articles around though as I
done that, I’m not sure the best way.