Rails Easy Data Dumping
- by Madhan ayyasamy
Hi Friends,The following useful snippets,you can find out the easiest way of ruby on rails environment data dumping. You’ll often need to get data from production to dev or dev to your local or your local to another developer’s local. One plug-in we use over and over is Yaml_db. This nifty little plug-in enables you to dump or load data by issuing a Rake command. The data is persisted in a yaml file located in db/data.yml. This is very portable and easy to read if you need to examine the data.01rake db:data:dump02 03example data found in db/data.yml04 05---06campaigns:07 columns:08 - id09 - client_id10 - name11 - created_at12 - updated_at13 - token14 records:15 - - "1"16 - "1"17 - First push18 - 2008-11-03 18:23:5319 - 2008-11-03 18:23:5320 - 3f2523f6a66521 - - "2"22 - "2"23 - First push24 - 2008-11-03 18:26:5725 - 2008-11-03 18:26:5726 - 9ee8bc427d94