Skip to content
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

Fixes missing method path_for when using MirrorService with DiskService as the primary service #35268

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion activestorage/lib/active_storage/service/mirror_service.rb
Expand Up @@ -9,7 +9,7 @@ module ActiveStorage
class Service::MirrorService < Service
attr_reader :primary, :mirrors

delegate :download, :download_chunk, :exist?, :url, to: :primary
delegate :download, :download_chunk, :exist?, :url, :path_for, to: :primary

# Stitch together from named services.
def self.build(primary:, mirrors:, configurator:, **options) #:nodoc:
Expand Down
4 changes: 4 additions & 0 deletions activestorage/test/service/mirror_service_test.rb
Expand Up @@ -61,4 +61,8 @@ class ActiveStorage::Service::MirrorServiceTest < ActiveSupport::TestCase
@service.url(@key, expires_in: 2.minutes, disposition: :inline, filename: filename, content_type: "text/plain")
end
end

test "path for file in primary service" do
assert_equal @service.primary.path_for(@key), @service.path_for(@key)
end
georgeclaghorn marked this conversation as resolved.
Show resolved Hide resolved
end