diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-11-17 01:37:50 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-12-17 01:28:38 +0300 |
commit | 3a2905f5072f451b4b1f284c4383b4054a8892af (patch) | |
tree | b1d84a799b2255bb8ea3bea81200250c63f48d15 /app/controllers/groups/group_members_controller.rb | |
parent | 4b7a3d0c38126489c42a207411b510b5a7b3264b (diff) |
Sort group/project members alphabetically by default
Diffstat (limited to 'app/controllers/groups/group_members_controller.rb')
-rw-r--r-- | app/controllers/groups/group_members_controller.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/groups/group_members_controller.rb b/app/controllers/groups/group_members_controller.rb index 812aaa4c191..4f273a8d4f0 100644 --- a/app/controllers/groups/group_members_controller.rb +++ b/app/controllers/groups/group_members_controller.rb @@ -1,16 +1,18 @@ class Groups::GroupMembersController < Groups::ApplicationController include MembershipActions + include SortingHelper # Authorize before_action :authorize_admin_group_member!, except: [:index, :leave, :request_access] def index + @sort = params[:sort].presence || sort_value_name @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) @members = @members.search(params[:search]) if params[:search].present? - @members = @members.sort(@sort = params[:sort]) if params[:sort].present? + @members = @members.sort(@sort) @members = @members.page(params[:page]).per(50) @requesters = AccessRequestsFinder.new(@group).execute(current_user) |