This repository has been archived by the owner on Oct 5, 2018. It is now read-only.
forked from jstorimer/delayed_paperclip
-
Notifications
You must be signed in to change notification settings - Fork 155
Home
Kevin Trowbridge edited this page May 9, 2014
·
1 revision
To get the delayed_paperclip worker process to clear the cache, setup an after_post_process
callback in your model, and have it call into your sweeper:
after_post_process :clear_cache
def clear_cache
sweeper_class = (self.class.to_s + 'Sweeper').constantize
sweeper_class.instance.after_save(self)
end
In the case of uploading an image that needs to be processed in the background, the processing image is nice for giving feedback to the user that initiated the upload. However, it's not necessarily useful for other users of the site. For them, a default image, hiding that area of the page, or other options, are nice to have.
One option is to add the 'processing' boolean to your model, but disable the processing image by setting 'url_with_processing' to false. Then you have other options for hiding or presenting things.