- Class-level
process
definitions are only applied to the original file
- Versions are generated based on the processed original file
- Callbacks (
before
/after
) are applied to original file and each version by itself
- Under the hood, a version is an instance of the uploader class that has no versions
- Version uploader and original uploader can be distinguished by checking
#version_name
: version uploaders return the version name, whereas the original uploader instance returns nil
- Version instances do not have a reference to their parent uploader
class DemoUploader < CarrierWave::Uploader::Base
process :resize
before :cache, :do_something
version :thumb do
process :crop
end
private
def do_something(file)
case version_name
end
end