-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ActiveStorage configuration resolve_model_to_route is not picked up by rails_blob_* URL generator #41172
Comments
Related: I'm seeing
Is this by design? |
I wouldn't think this is intentional. From my understanding of the docs and release notes is that |
It looks like when we added proxying in #34477 the rails/activestorage/config/routes.rb Lines 18 to 24 in af9c910
direct :rails_representation do |representation, options|
- signed_blob_id = representation.blob.signed_id
- variation_key = representation.variation.key
- filename = representation.blob.filename
-
- route_for(:rails_blob_representation, signed_blob_id, variation_key, filename, options)
+ route_for(ActiveStorage.resolve_model_to_route, representation, options)
end and rails/activestorage/config/routes.rb Lines 30 to 32 in af9c910
direct :rails_blob do |blob, options|
- route_for(:rails_service_blob, blob.signed_id, blob.filename, options)
+ route_for(ActiveStorage.resolve_model_to_route, blob, options)
end |
@composerinteralia please see #41186 |
Ah, I totally missed your PR. Left one comment, but what you did makes sense to me. |
Steps to reproduce
config.active_storage.resolve_model_to_route = :rails_storage_proxy
.class Picture < ApplicationRecord; has_one_attached :file; end
.rails_blob_path
.Expected behavior
The link should start with
/rails/active_storage/blobs/proxy/
.Actual behavior
The link starts with
/rails/active_storage/blobs/redirect/
.System configuration
Rails version: 6.1.1
Ruby version: 2.7.2p137
The text was updated successfully, but these errors were encountered: