I'm working on an app that uses info from a government database. For a
variety of reasons (not the least of which is that their database is in
MS Access), I can't simply write a wrapper around the legacy database.
Instead, we're looking to have an "import" script in the Rails
environment (it's fine if it's run from the server and through the web)
that will open up a connection to another MySQL schema and selectively
import data into the Rail app's database.
What's a good way to go about this? From the message board, it looks
like the best route is to make a script that instantiates an
ActiveRecord::Base connection, and then loads information out of the
government database (exported to MySQL) into the appropriate
ActiveRecord objects, and saves these objects to the new database. I'm
unclear as to how to set this up though. Will Rails magically load the
environment so I can just create a new Foo object and save it, or will
I need to require some files? Where is an appropriate place to put this
script? The lib folder, vendor folder, elsewhere?
Any other suggestions on how to go about this would be equally