Skip to content

Commit

Permalink
Order the profile page gems by downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
dancristianb committed Mar 19, 2024
1 parent 138608f commit f5a4918
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/controllers/profiles_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ class ProfilesController < ApplicationController
before_action :disable_cache, only: :edit

def show
@user = User.includes(rubygems_downloaded: %i[most_recent_version gem_download]).strict_loading
@user = User.includes(rubygems_downloaded: %i[most_recent_version gem_download])
.order("gem_downloads_rubygems.count DESC").strict_loading
.find_by_slug!(params[:id])
rubygems = @user.rubygems_downloaded.to_a
@rubygems = rubygems.slice!(0, 10)
Expand Down

0 comments on commit f5a4918

Please sign in to comment.