Skip to content

How to: use callbacks

hulihanapplications edited this page Sep 13, 2011 · 6 revisions

Callbacks

Callbacks allow you to hook in your own code when a particular CarrierWave event occurs. The following callbacks are available for use in CarrierWave:

  • :cache
  • :retrieve_from_cache
  • :store
  • :retrieve_from_store
  • :remove

Example

after :cache, :unlink_original

def unlink_original(file)
  return unless delete_original_file
  file.delete if version_name.blank?
end
Clone this wiki locally