RoR 4 - Connection to multiple databases

Hi there,

is it somehow possible to connect from a running Rails4-app to another
database?

My problem is that I have to transfer records from a table from the main
database to a different database.

Hi there,

is it somehow possible to connect from a running Rails4-app to another
database?

Yes, I have done this in the past for migration reasons. You can create a different connection "long-hand" and get a specific model to use it. The last answer on this page (sadly zero-rated) has the solution I used. http://stackoverflow.com/questions/12379730/query-remote-database-from-rails-3-2-application

Walter

I actually ran into this same use case a couple of months back and using class abstraction did the trick beautifully.

Try https://github.com/atombender/multidb as well. Very simple DSL and can be used for this stuff.