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

Conversation

abhaynikam
Copy link
Contributor

@abhaynikam abhaynikam commented Feb 14, 2019

@georgeclaghorn
Copy link
Contributor

Thanks, @abhaynikam. This needs a test.

@abhaynikam abhaynikam force-pushed the 35252-add-delegate-for-path-for-method branch 4 times, most recently from fc81332 to b14bb71 Compare February 14, 2019 15:46
@abhaynikam
Copy link
Contributor Author

@georgeclaghorn : Added test cases. Please let me know if we should add more cases.

@abhaynikam abhaynikam force-pushed the 35252-add-delegate-for-path-for-method branch from b14bb71 to 38ab8fd Compare February 14, 2019 17:15
@@ -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.url_for(@key)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I used url_for in my example when I meant path_for. 🤦‍♂️

Suggested change
assert_equal @service.primary.path_for(@key), @service.url_for(@key)
assert_equal @service.primary.path_for(@key), @service.path_for(@key)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. My bad. I should have checked it.

@abhaynikam abhaynikam force-pushed the 35252-add-delegate-for-path-for-method branch from 38ab8fd to d3f9226 Compare February 14, 2019 17:38
@abhaynikam
Copy link
Contributor Author

@georgeclaghorn : Done with the changes.

@georgeclaghorn georgeclaghorn merged commit eaf6d18 into rails:master Feb 14, 2019
@georgeclaghorn
Copy link
Contributor

Thank you!

georgeclaghorn added a commit that referenced this pull request Feb 14, 2019
…-for-method

Fixes missing method `path_for` when using MirrorService with DiskService as the primary service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants