Replicate is a Gem that lets you dump and load relational objects between Ruby/Ruby on Rails environments, e.g. dump data from your production database and load it in your development database.
The examples given in the README are of shell scripts being used to do this. I wanted to use a Capistrano task because it keeps everything related to the production site in one place (particularly the config).
Note: This is tested on a relatively small data set yet it still took about 20 seconds to run - YMMV!
- Add the code below to your
- Alter the
code = ENV["DATA"] || "User.all; Project.all"line to list all the data you want dumped by default