Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (20 sloc) 768 Bytes
title
Multi Cache

The multi_cache plugin allows an attacher to accept files from additional temporary storages.

Shrine.storages = { cache: ..., cache_one: ..., cache_two: ..., store: ... }

Shrine.plugin :multi_cache, additional_cache: [:cache_one, :cache_two]
photo.image = { "id" => "...", "storage" => "cache", "metadata" => { ... } }
photo.image.storage_key #=> :cache
# or
photo.image = { "id" => "...", "storage" => "cache_one", "metadata" => { ... } }
photo.image.storage_key #=> :cache_one
# or
photo.image = { "id" => "...", "storage" => "cache_two", "metadata" => { ... } }
photo.image.storage_key #=> :cache_two
You can’t perform that action at this time.