If, for example, you, in your database.yml, are something like this (don't really remember the correct attributes, but I think you understand):
postgres: adapter: postgres database: gis mysql: adapter: mysql database: app
Then you can add
establish_connection :postgres
in models that should use the Postgres database. Of course, it would be easier to create an abstract class and force all models to use it instead, since it is more DRYer.
class PostgresRecord::Base < ActiveRecord::Base self.abstract_class = true establish_connection :postgres end
Or, since you plan to eventually migrate to Postgres, you should probably do the opposite, make the default Postgres database, and change the connection for MySQL.
source share