| Rails411 |
| Dump or Slurp YAML Reference Data (and Fixtures) |
|
Sometimes you need to save data and use it again when you deploy a server or continue a project on a different machine. I wrote a plugin for ActiveRecord that lets you do this easily. It adds two class methods that let you dump_to_file and load_from_file. The contents are written to the ‘db’ directory with the table name as the filename. When you call Model.load_from_file, existing data in that table is deleted and reloaded, but primary key id’s are kept intact.... |
| Listing Information | ||||
|---|---|---|---|---|
| Website: | http://nubyonrails.com/articles/2005/12/27/dump-or-slurp-yaml-reference-data | |||
| Average Visitor Rating: | 0.00 (Out of 5) | |||
| Number of ratings: | 0 | |||
| Hits: | 515 | |||
| Added: | 2006-05-22 12:50:02 | |||
| Last updated: | 2006-07-17 12:32:20 | |||