I’m working on an app which will be receiving periodic snapshots from a
government database. This database is somewhat of a mess, so using the
design pattern of writing a wrapper around a legacy database is not an
option. Instead, I’d like to write an import script that opens a
connection to the legacy database and the Rail app’s database and then
selectively imports data.
What is a good way to do this? It looks like I need to use the
ActiveRecord::Base’s establish connection, but where/how should I place
this script so that I can create ActiveRecord objects and save them to
the new database? It doesn’t need to be run from the website.
Thanks!