Thanks for the responses Nicholas and Oleg. I have unique constraints in the database, but was wondering there might be a "simple" (or "common") pattern for this. A fairly "dumb" script will be performing the upload, and I'm hoping to avoid implementing much in the way of exception handling.
I'm currently working on parsing XML from the server. The list of items (that I need to be unique) shouldn't be too large to just retrieve and compare against before uploading to the server. I was considering creating actions to check the pre-existence of items, but it doesn't feel right to create actions for something a user will never do directly, and what will hopefully be run rarely. Cheers, -- Craig Read @Catharz https://github.com/Catharz http://code.google.com/p/bsss On 13/12/2011, at 10:43 PM, Oleg Ivanov <[email protected]> wrote: > What kind of data are you working with? If it's not something > involving uniqueness tests on large texts/binaries, then I'd say it's > a valid use case for validations and unique indices in the database > (if you're using a relational one). > > -- > You received this message because you are subscribed to the Google Groups > "Ruby or Rails Oceania" 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/rails-oceania?hl=en. > -- You received this message because you are subscribed to the Google Groups "Ruby or Rails Oceania" 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/rails-oceania?hl=en.
