From 21d5bb33a296716c21371a809f5d9b6baeb54c17 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Sun, 2 Dec 2018 22:31:44 +0000 Subject: [PATCH] Use sorted instead of sort (#29406). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Patch by Pavel Rosický. git-svn-id: http://svn.redmine.org/redmine/trunk@17685 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/files_controller.rb | 2 +- app/controllers/projects_controller.rb | 2 +- app/controllers/reports_controller.rb | 12 ++++++------ app/views/projects/settings/_versions.html.erb | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 6aa55f8a6..bc66c80b0 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -44,7 +44,7 @@ class FilesController < ApplicationController end def new - @versions = @project.versions.sort + @versions = @project.versions.sorted end def create diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 820aa6c81..a43038a98 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -176,7 +176,7 @@ class ProjectsController < ApplicationController @version_status = params[:version_status] || 'open' @version_name = params[:version_name] - @versions = @project.shared_versions.status(@version_status).like(@version_name) + @versions = @project.shared_versions.status(@version_status).like(@version_name).sorted end def edit diff --git a/app/controllers/reports_controller.rb b/app/controllers/reports_controller.rb index cfef2f200..a4ea33b6f 100644 --- a/app/controllers/reports_controller.rb +++ b/app/controllers/reports_controller.rb @@ -21,11 +21,11 @@ class ReportsController < ApplicationController def issue_report @trackers = @project.rolled_up_trackers(false).visible - @versions = @project.shared_versions.sort + @versions = @project.shared_versions.sorted @priorities = IssuePriority.all.reverse @categories = @project.issue_categories - @assignees = (Setting.issue_group_assignment? ? @project.principals : @project.users).sort - @authors = @project.users.sort + @assignees = (Setting.issue_group_assignment? ? @project.principals : @project.users).sorted + @authors = @project.users.sorted @subprojects = @project.descendants.visible with_subprojects = Setting.display_subprojects_issues? @issues_by_tracker = Issue.by_tracker(@project, with_subprojects) @@ -49,7 +49,7 @@ class ReportsController < ApplicationController @report_title = l(:field_tracker) when "version" @field = "fixed_version_id" - @rows = @project.shared_versions.sort + @rows = @project.shared_versions.sorted @data = Issue.by_version(@project, with_subprojects) @report_title = l(:field_version) when "priority" @@ -64,12 +64,12 @@ class ReportsController < ApplicationController @report_title = l(:field_category) when "assigned_to" @field = "assigned_to_id" - @rows = (Setting.issue_group_assignment? ? @project.principals : @project.users).sort + @rows = (Setting.issue_group_assignment? ? @project.principals : @project.users).sorted @data = Issue.by_assigned_to(@project, with_subprojects) @report_title = l(:field_assigned_to) when "author" @field = "author_id" - @rows = @project.users.sort + @rows = @project.users.sorted @data = Issue.by_author(@project, with_subprojects) @report_title = l(:field_author) when "subproject" diff --git a/app/views/projects/settings/_versions.html.erb b/app/views/projects/settings/_versions.html.erb index 388c6ae0a..80d67cc24 100644 --- a/app/views/projects/settings/_versions.html.erb +++ b/app/views/projects/settings/_versions.html.erb @@ -32,7 +32,7 @@ -<% @versions.sort.each do |version| %> +<% @versions.each do |version| %> <%= link_to_version version %> <%= checked_image(version.id == @project.default_version_id) %> -- 2.39.5