From 07609d34c81597723b20505e0ade12defbe211ee Mon Sep 17 00:00:00 2001 From: Jure Grabnar Date: Wed, 27 Mar 2019 13:49:55 +0100 Subject: [PATCH] User/teams are now alphabetically listed --- app/controllers/global_activities_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/global_activities_controller.rb b/app/controllers/global_activities_controller.rb index 36a2beb9e..339b3c1a4 100644 --- a/app/controllers/global_activities_controller.rb +++ b/app/controllers/global_activities_controller.rb @@ -6,13 +6,14 @@ class GlobalActivitiesController < ApplicationController selected_teams = if request.format.html? current_team elsif activity_filters[:teams].present? - @teams.where(id: activity_filters[:teams]) + @teams.where(id: activity_filters[:teams]).order(name: :asc) else - @teams + @teams.order(name: :asc) end @activity_types = Activity.activity_types_list @user_list = User.where(id: UserTeam.where(team: current_user.teams).select(:user_id)) .distinct + .order(full_name: :asc) .pluck(:full_name, :id) @grouped_activities, @more_activities = ActivitiesService.load_activities(current_user, selected_teams, activity_filters)