I read your post this morning and thought, "WOW!  Rails has defined an
approach for seeding data.  That's great!  I'll have to look into
that."  But I didn't have an answer for you.  Then later this morning,
I went looking for something I'd seen on Ryan Bates excellent
Railscasts site (http://railscasts.com/) and found episode #179
staring me in the face.  I highly recommend watching Ryan's tutorial
on the subject, but I can give you the punchline:
#find_or_create_by_name("blah"), or, alternatetively,
Mytable.delete_all.

--wpd

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to