It looks like ActiveStorage::Variant
uses the following key
, which is derivative of the original blob’s key.
def key
"variants/#{blob.key}/#{Digest::SHA256.hexdigest(variation.key)}"
end
However, ActiveStorage::VariantWithRecord
’s key
has no reference at all to the original blob
’s key
.
Given that custom keys for the original blob
were made available in this commit Allow providing a custom key per blob · rails/rails@4dba136 · GitHub, should VariantWithRecord
‘respect’ any prefixing/namespacing that might have been used in the original blob
’s key
?
For example, if my blob
key
has been customized to be company2/attachments/myblob.jpeg
, should it follow that any variants
should also be located somewhere within company2/attachments
rather than having completely random keys that live entirely in the root “path”? E.g. would company2/attachments/myblob.jpeg/variants/[variant_hash]
be more desirable as the key than simply [randomkey]
?