Commit 5e131bca authored by Camil Staps's avatar Camil Staps

Make sure starred_since is of the requested project in StarrersController; cleanup

parent 38282685
...@@ -13,7 +13,9 @@ class Projects::StarrersController < Projects::ApplicationController ...@@ -13,7 +13,9 @@ class Projects::StarrersController < Projects::ApplicationController
params[:has_starred] = @project params[:has_starred] = @project
@starrers = UsersFinder.new(current_user, params).execute @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) @starrers = @starrers.sort_by_attribute(@sort)
end end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
......
- 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")
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment