| 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.... |
|
Average Visitor Rating: 0.00 (Out of 5)
Number of ratings: 0 |
| Select your rating |