Issue
If images are uploaded between enable_s3_uploads
being configured and enabled and the rake uploads:migrate_to_s3
task being run, the URLs of the aforementioned images (i.e., those that were uploaded in the space between the configuration change and the rake task being run) will be incorrectly processed.
Steps to Replicate
- Configure and enable
enable_s3_uploads
. - Upload an image somewhere on the forum.
- Run
rake uploads:migrate_to_s3
.
The image uploaded in step 2 will not load properly due to having an incorrect URL.
Proposed Solution
Perhaps the migrate_to_s3
script should check for images that are already present on S3.
(Granted, this is very clearly a type of ‘user error’ as the forum should probably be locked when migrating.)