diff options
author | Camil Staps <info@camilstaps.nl> | 2019-01-28 13:19:53 +0100 |
---|---|---|
committer | Camil Staps <info@camilstaps.nl> | 2019-08-07 20:49:14 +0200 |
commit | 6baff6504b234e209a5e1d78349dbd2589d5d7e8 (patch) | |
tree | 809269461586e00974cb8c309c77aca77b058e49 /app/controllers/projects/starrers_controller.rb | |
parent | 91f574b820e03b4abb97a8351e420d1ef24e8505 (diff) | |
download | gitlab-ce-6baff6504b234e209a5e1d78349dbd2589d5d7e8.tar.gz |
Change sorting options for starrers: name (asc/desc), most/least recent star
Diffstat (limited to 'app/controllers/projects/starrers_controller.rb')
-rw-r--r-- | app/controllers/projects/starrers_controller.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/app/controllers/projects/starrers_controller.rb b/app/controllers/projects/starrers_controller.rb index cb230242e6e..6ca49fceff6 100644 --- a/app/controllers/projects/starrers_controller.rb +++ b/app/controllers/projects/starrers_controller.rb @@ -10,12 +10,9 @@ class Projects::StarrersController < Projects::ApplicationController def index @sort = params[:sort].presence || sort_value_name - params[:has_starred] = @project + params[:project] = @project - @starrers = UsersFinder.new(current_user, params).execute - @starrers = @starrers.joins(:users_star_projects) - .select('"users".*, "users_star_projects"."created_at" as "starred_since"') - .where(users_star_projects: { project_id: @project.project_id }) + @starrers = UsersStarProjectsFinder.new(params).execute @starrers = @starrers.sort_by_attribute(@sort) end # rubocop: enable CodeReuse/ActiveRecord |