Forum: Ruby on Rails Fixture like imports...

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Cfd2ef8c8ccf61c83b37185499162261?d=identicon&s=25 mvargo (Guest)
on 2007-01-17 21:08
(Received via mailing list)
I am building a site where a user will ftp a bunch of media files to a
server(s).  I have a process that runs against all those files and
creates a yml and sql file that can be used to import them into my ruby
on rails application running somewhere completely different.

If I use the sql file, it bypasses all my great validation code in the
model (no good)
I would like to import the yml file.  I can see how to do that with
fixtures, but not sure how it will work.

Does not fixtures :items wipe out the exiting data in the table and
replace it with the stuff in items.yml?  Is there a way to have it just
run through them and add them to the table.  I suppose my next question
will be a way to have it ignore validation failures and keep going.

I suppose I could write code to crack open the file and read the
records but that seems very unDRY.  Any pointers would be very much


This topic is locked and can not be replied to.