Attacher#create_derivativesmethod now accepts a
:storageoption for specifying the storage to which derivatives should be uploaded.# with attachment modulephoto.image_derivatives!(storage: :other_store)# with attacherattacher.create_derivatives(storage: :other_store)
Shrine.calculate_signaturenow accepts a
:rewindboolean option for choosing whether the IO object should be rewinded after reading. This is useful if you want to calculate signature from non-rewindable IO objects, such as
Down::ChunkedIOetc.Shrine.signature(io, rewind: false)
The derivatives processor can now be registered with
Attacher.derivatives, which is just an alias for
Attacher.derivatives_processor.Attacher.derivatives_processor do |original|# ...endend# can now be written asAttacher.derivatives do |original|# ...endend
Attacher#stored?methods now work correctly if temporary/permanent storage identifiers were specified as strings.
store_dimensionsplugin now properly propagates exceptions when loading the
add_metadataplugin now respects inheritance again when defining metadata methods on the
Shrine::UploadedFileclass. In 2.19.0, the
add_metadataplugin was changed to define metadata methods on the internal
FileMethodsplugin module, which is shared across all uploaders. This change has now been reverted.
Attacher#store_keymethods now always return symbol keys, even if the storage key that was specified was a string key.attacher = Shrine::Attacher.new(cache: "cache", store: "store")attacher.cache_key #=> :cache (previously "cache")attacher.store_key #=> :store (previously "store")
add_metadataplugin now defines metadata methods directly on the
UploadedFileclass, which means that if you happen to have been overriding these metadata methods and calling
super, this won't work anymore.