Commit Graph

4 Commits

Author SHA1 Message Date
Maikel Linke
a110ee0982 Simplify Active Storage config for test env 2023-11-15 10:29:05 +01:00
Matt-Yorkley
e54cff2274 Set images to public-read
Defining an alternate s3 configuration set to `public: true` means we can use it selectively. It sets the objects to `acl: "public-read"` by default (read-only) and means any image tags for those assets can use direct public links in the src attribute (without hitting the ActiveStorage::Representation endpoint). The default non-public service will still be used by default for any other files on instances using s3.
2023-06-14 10:56:10 +01:00
Maikel Linke
ec64e5c8f7 Store images with Active Storage as well
While we migrate from Paperclip to Active Storage, we need to use both
at the same time to avoid any downtime or lost images.

Once the migration is complete, we want to use the same name for
attachment as before. Using Paperclip and Active Storage at the same
time creates a name conflict on a couple of methods.

I'm using alias_method as a temporary solution to access Active Storage
methods. We will remove that after the migration. I declare Paperclip
afterwards so that we have those methods declarations for backwards
compatibility now.
2022-04-25 13:00:31 +10:00
Maikel Linke
95cb6e93e7 Configure Active Storage
We are re-using the same config used for Paperclip except for disk
storage. Active Storage uses directory sharding on the local disk which
means that we can't create blob entries that point to the existing
Paperclip files. We will just copy them to the standard `storage/`
directory.
2022-04-25 13:00:30 +10:00