Use #latest_version
when loading the profile page rubygems
#4627
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #4624
This PR targets fixing the profile page gem versions issue described in #4624. I've pulled down a copy of the data using the instructions in https://github.com/rubygems/rubygems.org/blob/master/CONTRIBUTING.md#getting-the-data-dumps and tried it out locally. The fix seems to work correctly π
I'm not sure if this is the best approach though π€ I also found that this is somewhat related to eager loading the
gem_download
association in https://github.com/rubygems/rubygems.org/blob/master/app/controllers/profiles_controller.rb#L12.So if on
master
I remove thegem_download
eager load and stub out therubygem.downloads
call from the view (so I don't hit theActiveRecord::StrictLoadingViolationError
exception) I see the correctinvisible_captcha
2.2.0
version (this is using themost_recent_version
call). There's something happening with the scope there but I'm having trouble piecing it together π€So this is what the page looks like before the PR updates
This is what the page looks like after the PR updates β