diff options
author | Camil Staps <info@camilstaps.nl> | 2019-01-27 11:51:17 +0100 |
---|---|---|
committer | Camil Staps <info@camilstaps.nl> | 2019-08-07 20:49:14 +0200 |
commit | 5e131bcaf19a91b96e7f1adb55fcd93c466e7d46 (patch) | |
tree | 219b04acfc844557b2ac0127357c61076c1b81d6 /app | |
parent | 382826855c77986823691d74e1e6b47ad715d652 (diff) | |
download | gitlab-ce-5e131bcaf19a91b96e7f1adb55fcd93c466e7d46.tar.gz |
Make sure starred_since is of the requested project in StarrersController; cleanup
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/projects/starrers_controller.rb | 4 | ||||
-rw-r--r-- | app/views/shared/users/_user.html.haml | 12 |
2 files changed, 3 insertions, 13 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 diff --git a/app/views/shared/users/_user.html.haml b/app/views/shared/users/_user.html.haml deleted file mode 100644 index ae014176e54..00000000000 --- a/app/views/shared/users/_user.html.haml +++ /dev/null @@ -1,12 +0,0 @@ -- user = local_assigns.fetch(:user) - -%li.member{ class: dom_class(user), id: dom_id(user) } - %span.list-item-name - = image_tag avatar_icon_for_user(user, 40), class: "avatar s40", alt: '' - .user-info - = link_to user.name, user_path(user), class: 'member js-user-link', data: { user_id: user.id } - %br - %span.cgray= user.to_reference - - - if user == current_user - %span.badge.badge-success.prepend-left-5= _("It's you") |