Skip to content
Snippets Groups Projects
Commit cdc55db3 authored by Phil Hughes's avatar Phil Hughes
Browse files

Fixed members error

parent b3d75ac5
No related branches found
No related tags found
No related merge requests found
Loading
@@ -6,7 +6,7 @@ class Projects::ProjectMembersController < Projects::ApplicationController
Loading
@@ -6,7 +6,7 @@ class Projects::ProjectMembersController < Projects::ApplicationController
   
def index def index
@groups = @project.project_group_links @groups = @project.project_group_links
@project_members = @project.team.members(can?(current_user, :admin_project, @project)) @project_members = @project.team.members(!can?(current_user, :admin_project, @project))
@project_members_size = @project_members.size @project_members_size = @project_members.size
   
if params[:search].present? if params[:search].present?
Loading
Loading
Loading
@@ -52,7 +52,7 @@ class ProjectTeam
Loading
@@ -52,7 +52,7 @@ class ProjectTeam
ProjectMember.truncate_team(project) ProjectMember.truncate_team(project)
end end
   
def members(non_invite) def members(non_invite = false)
@members ||= fetch_members(nil, non_invite) @members ||= fetch_members(nil, non_invite)
end end
alias_method :users, :members alias_method :users, :members
Loading
@@ -236,7 +236,7 @@ class ProjectTeam
Loading
@@ -236,7 +236,7 @@ class ProjectTeam
end end
   
user_ids = project_members.pluck(:user_id) user_ids = project_members.pluck(:user_id)
user_ids.push(*invited_members.map(&:user_id)) if invited_members.any? && !non_invite user_ids.push(*invited_members.map(&:user_id)) if invited_members.any? && non_invite
user_ids.push(*group_members.pluck(:user_id)) if group user_ids.push(*group_members.pluck(:user_id)) if group
   
User.where(id: user_ids) User.where(id: user_ids)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment