Skip to content

Instantly share code, notes, and snippets.

View ruby-railings's full-sized avatar

ruby-railings

View GitHub Profile
@ruby-railings
ruby-railings / bulk_processor.rb
Last active January 7, 2016 00:46
This is a bulk processor for Paperclip. Depending on the number of styles, it can speed up the generation of multiple thumbnails. Read more at http://www.ruby-railings.de/de/rails/paperclip/2014/01/26/speed-up-paperclip.html (German) or http://www.ruby-railings.com/de/rails/paperclip/2014/01/26/speed-up-paperclip.html (English)
module Paperclip
# A wrapper for a queued item. Normally this would be a temporary file, but we can't do that, because Paperclip
# would copy the temporary file before the content is actually written.
class BulkQueueItem
attr_reader :destination
def initialize(destination)
@destination = destination
end
end