lardawge/carrierwave_backgrounder — pull request #138 by rovermicrover (2013-05-15 18:36:53+00:00)
Title: Added #{column}_processing functionality to the store worker also.

This commit adds the functionality of #{column}_processing to the store worker also, not just the processing worker.

I ended up needing this for a project where I am dynamically resizing an image based on the model attributes. If someone ended up submitting two changes, one right after the other, to the images or the attributes it worked off of, a race condition would issue, where one image ended uploaded with the others crop. The only way to stop this was to check for #{column}_processing before save.

I would have liked to have checked for store also, but that happens after save so adding a flag in for that was not really possible. Also store didn't matter because the conditional processing had already been done. So worst case you end up with the 'wrong' one uploaded, but with the correct corresponding crop.