summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorCamil Staps <info@camilstaps.nl>2019-01-27 11:51:17 +0100
committerCamil Staps <info@camilstaps.nl>2019-08-07 20:49:14 +0200
commit5e131bcaf19a91b96e7f1adb55fcd93c466e7d46 (patch)
tree219b04acfc844557b2ac0127357c61076c1b81d6 /app/controllers
parent382826855c77986823691d74e1e6b47ad715d652 (diff)
downloadgitlab-ce-5e131bcaf19a91b96e7f1adb55fcd93c466e7d46.tar.gz
Make sure starred_since is of the requested project in StarrersController; cleanup
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects/starrers_controller.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/projects/starrers_controller.rb b/app/controllers/projects/starrers_controller.rb
index 5939a3885c6..cb230242e6e 100644
--- a/app/controllers/projects/starrers_controller.rb
+++ b/app/controllers/projects/starrers_controller.rb
@@ -13,7 +13,9 @@ class Projects::StarrersController < Projects::ApplicationController
params[:has_starred] = @project
@starrers = UsersFinder.new(current_user, params).execute
- @starrers = @starrers.joins(:users_star_projects).select('"users".*, "users_star_projects"."created_at" as "starred_since"')
+ @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 = @starrers.sort_by_attribute(@sort)
end
# rubocop: enable CodeReuse/ActiveRecord