Last week I wrote this code to allow you to easily create models/
records using FasterCSV... it doesn't directly answer your question,
but it might help or at least give you some ideas:
http://pastie.org/676681
If it looks this would be useful to you or others I can post it on
github; I also have a test suite for it. - pat
Sorry... forgot to mention the way it works is:
- the first row of the CSV is taken as a list of column names
- the remaining csv rows are data for new models
- if your model contains a column/attribute matching one of the csv
column names, it will be loaded
- each new record is yielded to a block provided.