Multiple Databases - Archive and Current Databases Question

I've got a few different databases - 2 that hold archive data and 1 that
holds current working application data.

The 2 archive databases hold tables for quality assurance and are
extremely large datasets, but they are not part of the working rails
application. The way that it works is that I need to query data in the
2 archive databases before I run a job in the rails app. If the 2
queries don't bring back the expected results, I don't want to run the

What is the best way to set up the connections to run the queries in the
2 archive databases prior to running a job in the rails app? Do I need
to create separate models for the archive queries? If so, how do I make
sure to tell my controller to run those before running the job? Or does
this all fit into the model that runs the job with these queries running
first? If so, how do I query the other 2 databases?

Thanks once again for the amazing help!