It can be a bit of a mystery, but they've used a simple pattern.
You can find the exact file that is attached to your model locally by looking in the storage
directory at the root of the app.
What isn’t clear is where you go from storage
.
Rails groups all the files into directories based on the attachment’s key, where the first two chars of the key are the first directory, and the second two chars are the subdirectory.
E.g. if you have a project with a document attached
project.document.blob.key # -> 2dkawl12g1otdcnqo16bqzk5m67a
the actual file will be
storage/2d/ka/2dkawl12g1otdcnqo16bqzk5m67a
It was very helpful just now when I wanted to test purging the file and ensure it actually deleted afterwards.
— John Norris
Who are Dragon Drop?
Dragon Drop is a specialist web and app development agency. The team has extensive full-stack technical credentials and a strong focus on user experience.
The Dragon Drop founding team have over 40 years of web development and project experience. They have managed or developed over 100 significant ecommerce and web projects during their careers, including implementations for major UK high street retailers, financial services companies and government agencies.
Their approach to innovative solutions stems from perspectives gained as retailer, software supplier and web agency.