我如何用两个不同的数据库中轨,主动记录?数据库中、如何用、主动、不同

2023-09-08 15:40:57 作者:爱吃甜筒的猫

我需要使用不同的Rails型号不同的数据库连接。有没有不那么哈克的方式做到这一点?

I need to use different database connections in different Rails models. Is there a not-so-hacky way to do that?

任何链接或搜索关键词将是巨大的:)

Any links or search keywords would be great :)

推荐答案

mikej是正确的。但是我没有写的宝石,使得模型code连接一点点清洁,检查出来。

mikej is right. I did however write a gem that makes the model code to connect a little bit cleaner, check it out.