diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-11-17 00:37:51 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-12-17 01:28:38 +0300 |
commit | 59d43bea80b56faff54630934694b317cda9f899 (patch) | |
tree | 201fb66b0bc930dfc722008d6220ef9fbc8b2b6e /app/controllers/groups/group_members_controller.rb | |
parent | f54ddbf1ecb91ea96b52e18f87ff5ed10ad45747 (diff) |
Fix sort functionality for group/project members
Diffstat (limited to 'app/controllers/groups/group_members_controller.rb')
-rw-r--r-- | app/controllers/groups/group_members_controller.rb | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/app/controllers/groups/group_members_controller.rb b/app/controllers/groups/group_members_controller.rb index af8abb96d4a..812aaa4c191 100644 --- a/app/controllers/groups/group_members_controller.rb +++ b/app/controllers/groups/group_members_controller.rb @@ -6,19 +6,13 @@ class Groups::GroupMembersController < Groups::ApplicationController def index @project = @group.projects.find(params[:project_id]) if params[:project_id] + @members = @group.group_members @members = @members.non_invite unless can?(current_user, :admin_group, @group) - - if params[:search].present? - @members = @members.joins(:user).merge(User.search(params[:search])) - end - - if params[:sort].present? - @members = @members.joins(:user).merge(User.sort(@sort = params[:sort])) - end - - + @members = @members.search(params[:search]) if params[:search].present? + @members = @members.sort(@sort = params[:sort]) if params[:sort].present? @members = @members.page(params[:page]).per(50) + @requesters = AccessRequestsFinder.new(@group).execute(current_user) @group_member = @group.group_members.new |