Commit 931d09f4 authored by Phil Hughes's avatar Phil Hughes

Fixed search

parent 3e19f197
......@@ -10,21 +10,30 @@ class Projects::ProjectMembersController < Projects::ApplicationController
members = []
project_members = @project.project_members
project_members = project_members.non_invite unless can?(current_user, :admin_project, @project)
if params[:search].present?
users = @project.users.search(params[:search]).to_a
project_members = project_members.where(user_id: users)
end
members << project_members.pluck(:id)
if @project.group
group_members = @project.group.group_members
@group = @project.group
if @group
group_members = @group.group_members
group_members = group_members.non_invite unless can?(current_user, :admin_project, @project)
if params[:search].present?
users = @group.users.search(params[:search]).to_a
group_members = group_members.where(user_id: users)
end
members << group_members.pluck(:id)
end
@project_members = Member.where(id: members)
@project_members_size = @project_members.size
if params[:search].present?
@project_members = @project_members.search(params[:search])
end
@project_members = @project_members.page(params[:page])
@requesters = @project.requesters if can?(current_user, :admin_project, @project)
......
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