我有一个使用PostgreSQL存储所有信息的Rails 3.2应用程序。在rake任务中打开连接到mysql数据库
但是在一个Rake任务中,我需要与MySQL服务器建立连接。我试图做到这一点:
ActiveRecord::Base.establish_connection(
:adapter => "mysql2",
:database => "foo",
:user => "root",
:password => "",
)
但它只是用这个临时MySQL替换我的默认PostgreSQL连接。
如何为实例创建附加连接?
有没有这种方法的postgres版本? gem activerecord-postgresql-adapter(0.0.1) – Ari53nN3o 2012-09-25 18:11:03