Commit f7ae1bce258695b07c674d8857112f927f412b90

Authored by Dmitry Moskalchuk
1 parent a9c1b85e

Syntax fix of sorting groups/users

app/controllers/dashboard_controller.rb
... ... @@ -5,7 +5,7 @@ class DashboardController < ApplicationController
5 5 before_filter :event_filter, only: :show
6 6  
7 7 def show
8   - @groups = current_user.authorized_groups.sort_by { |x| x.human_name }
  8 + @groups = current_user.authorized_groups.sort_by(&:human_name)
9 9 @has_authorized_projects = @projects.count > 0
10 10 @teams = current_user.authorized_teams
11 11 @projects_count = @projects.count
... ...
app/helpers/namespaces_helper.rb
... ... @@ -10,8 +10,8 @@ module NamespacesHelper
10 10  
11 11  
12 12 global_opts = ["Global", [['/', Namespace.global_id]] ]
13   - group_opts = ["Groups", groups.sort_by {|g| g.human_name}.map {|g| [g.human_name, g.id]} ]
14   - users_opts = [ "Users", users.sort_by {|u| u.human_name}.map {|u| [u.human_name, u.id]} ]
  13 + group_opts = ["Groups", groups.sort_by(&:human_name).map {|g| [g.human_name, g.id]} ]
  14 + users_opts = [ "Users", users.sort_by(&:human_name).map {|u| [u.human_name, u.id]} ]
15 15  
16 16 options = []
17 17 options << global_opts if current_user.admin
... ...