Suppose one had a hypothetical situation in which records were entered into a database which were later determined to be invalid.
In this supposedly hypothetical situation, the agile programmer might add validations to the models to ensure this doesn't, err, wouldn't happen again. Following that, there might be some records in the database which were invalid. I like thinking about hypothetical questions and coming up with hypothetical answers, and I thought that perhaps there might be other readers on this list who enjoy that sort of game too. So, for those of you who enjoy that sort of thing, what would you do to address this? One thing I've thought of would be to write a throwaway rake task to iterate through the items in the the affected table(s), calling the validate function on each one and reporting the results back. If there were only a few invalid records, I could probably go in and fix them by hand. If there were too many, I might write another rake task to identify and fix them. If I did that, would I really "throwaway" the rake task when I was done? Probably not... I'd probably check it into source control and keep it just for documentation/history's sake. What would you do? --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 rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---