0

All is working fine with Active Storage to add an image to one of my records.

However, when I create a variant, it appears at the root of my S3 bucket, along with the file blob - e.g. 1nqwr0ncsnr57pcjsnoslame15sw. Docs and AI suggest it should have a variants/<blob_id> prefix.

This means when I destroy the model the variant isn't deleted, as the destroy process looks for files with a variants/<blob_id> prefix.

Disk Storage (0.3ms) Deleted file from key: dl9t4j18brouy3kxvf51zokmcrda
Disk Storage (0.0ms) Deleted files by key prefix: variants/dl9t4j18brouy3kxvf51zokmcrda/

I even tried creating a new rails app to test and getting the same - I have turned on variant tracking:

config.active_storage.track_variants = true

1 Answer 1

0

I changed track variants to false

config.active_storage.track_variants = false

Then variants were created in the expected place - I will have to look more in to how to ensure variants are deleted when tracking is true.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.