Forum: Ruby on Rails Getting a model to connect to a different DB

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
sirdavidoff (Guest)
on 2005-11-28 14:17
Hi guys,

I'm still finding my feet in rails and I would be really grateful if you
could help me with this problem:

I need to use 2 databases for my application; one for user details and
one for everything else. So basically what I think I need to do is set
the database to the general one as default and then tell the User model
specifically to connect to the user DB.

I have added an extra DB definition to the databases.yml file but I'm
not sure how to tell the User model to use this database. How can I do
this? There are instuctions on the rails wiki
( but
they don't seem to work ;(


sirdavidoff <> (Guest)
on 2005-11-28 16:53
Stupid me, turns out there was an article on the wiki about this:

Although why there have to be extra articles saying that another article
is wrong instead of just fixing the first article is beyond me ;)
This topic is locked and can not be replied to.