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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0e577200992b9f87fbfdb84f70ae2cea?d=identicon&s=25 sirdavidoff (Guest)
on 2005-11-28 13: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
(http://wiki.rubyonrails.com/rails/pages/HowtoUseMu...) but
they don't seem to work ;(

Thanks!

Sirdavidoff
0e577200992b9f87fbfdb84f70ae2cea?d=identicon&s=25 sirdavidoff <davewroberts@yahoo.com> (Guest)
on 2005-11-28 15:53
Stupid me, turns out there was an article on the wiki about this:

http://wiki.rubyonrails.com/rails/pages/HowtoUseMu...

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.