ActiveStorage::MirrorJob always uses the default service, even if overridden via has_*_attached ..., service: :another_service
#46806
Labels
has_*_attached ..., service: :another_service
#46806
I ran into this when trying to migrate all of my attached from local storage to s3. After setting up mirroring and running
ActiveStorage::Blob.find_each &:mirror_later
I was surprised to find all of my attachments in the default storage service, even if a different service had been specified viahas_*_attached ..., service: ...
I think the culprit is here:
rails/activestorage/app/jobs/active_storage/mirror_job.rb
Line 13 in a790203
ActiveStorage::Blob.service
the default service. The other jobs passblob
to perform... Is there any reason not to passblob
here as well, and useblob.service
instead ofActiveStorage::Blob.service
?If that's acceptable I'm happy to submit a PR. Thanks!
The text was updated successfully, but these errors were encountered: