From c52f7ffe26a690aa79b53a0de7526f290d5a47e8 Mon Sep 17 00:00:00 2001 From: rshorey Date: Wed, 26 Apr 2017 14:37:12 -0400 Subject: [PATCH 1/2] user names now sorted by full_name --- app/controllers/pages_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index a97944aa..9907d255 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -34,13 +34,13 @@ def show # GET /pages/new def new @page = Page.new - @users = User.all + @users = User.all.sort_by { |obj| obj.full_name.downcase } @slack_integrations = SlackIntegration.all end # GET /pages/1/edit def edit - @users = User.all + @users = User.all.sort_by { |obj| obj.full_named.downcase } @slack_integrations = SlackIntegration.all end From e29baa8eea59b2db335897292f75893dc1c5f08b Mon Sep 17 00:00:00 2001 From: rshorey Date: Wed, 26 Apr 2017 15:13:41 -0400 Subject: [PATCH 2/2] fix typo; change sort to display name --- app/controllers/pages_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 9907d255..34d29d18 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -34,13 +34,13 @@ def show # GET /pages/new def new @page = Page.new - @users = User.all.sort_by { |obj| obj.full_name.downcase } + @users = User.all.sort_by { |obj| (obj.display_name.nil? ? 0 : obj.display_name.downcase) } @slack_integrations = SlackIntegration.all end # GET /pages/1/edit def edit - @users = User.all.sort_by { |obj| obj.full_named.downcase } + @users = User.all.sort_by { |obj| (obj.display_name.nil? ? 0 : obj.display_name.downcase) } @slack_integrations = SlackIntegration.all end