diff options
author | Camil Staps <info@camilstaps.nl> | 2019-01-27 13:51:17 +0300 |
---|---|---|
committer | Camil Staps <info@camilstaps.nl> | 2019-08-07 21:49:14 +0300 |
commit | 5e131bcaf19a91b96e7f1adb55fcd93c466e7d46 (patch) | |
tree | 219b04acfc844557b2ac0127357c61076c1b81d6 /app/controllers/projects/starrers_controller.rb | |
parent | 382826855c77986823691d74e1e6b47ad715d652 (diff) |
Make sure starred_since is of the requested project in StarrersController; cleanup
Diffstat (limited to 'app/controllers/projects/starrers_controller.rb')
-rw-r--r-- | app/controllers/projects/starrers_controller.rb | 4 |
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 |