Replace Enumerable#sort with faster Enumerable#sort_by (#29299).

Patch by Go MAEDA.


git-svn-id: http://svn.redmine.org/redmine/trunk@17462 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2018-08-02 21:54:21 +00:00
parent c76a021e92
commit eee1c36b4b
11 changed files with 12 additions and 12 deletions

View File

@@ -2,7 +2,7 @@ namespace :redmine do
desc "List all permissions and the actions registered with them"
task :permissions => :environment do
puts "Permission Name - controller/action pairs"
Redmine::AccessControl.permissions.sort {|a,b| a.name.to_s <=> b.name.to_s }.each do |permission|
Redmine::AccessControl.permissions.sort_by {|p| p.name.to_s}.each do |permission|
puts ":#{permission.name} - #{permission.actions.join(', ')}"
end
end