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. Query Remote Database from Rails 3.2 Application - Stack Overflow

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.