I’m building a Rails application, and something I’ll need to do regularly is load new data from an external source into the database. I want to build some tools to do this data load, but it’s the sort of task I’ll want to run manually, ideally from the command line, rather than fully automate it or have an automatic background task. And I’d like to use the model objects to do this, rather than directly dump data into the appropriate tables.
What’s the best way to do this in terms of the Rails project organization? It would be perfect if someone could point me to an existing FOSS application that does this. Haven’t found good information in either of my go-to sources, the Rails Guides and Railscasts.com.
Well, there’s a Rails Guide on Rake tasks and other command-line tools, and there’s a Railscast on the topic of custom rake tasks.