]> source.dussan.org Git - redmine.git/commitdiff
Use sorted instead of sort (#29406).
authorGo MAEDA <maeda@farend.jp>
Sun, 2 Dec 2018 22:31:44 +0000 (22:31 +0000)
committerGo MAEDA <maeda@farend.jp>
Sun, 2 Dec 2018 22:31:44 +0000 (22:31 +0000)
Patch by Pavel Rosický.

git-svn-id: http://svn.redmine.org/redmine/trunk@17685 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/files_controller.rb
app/controllers/projects_controller.rb
app/controllers/reports_controller.rb
app/views/projects/settings/_versions.html.erb

index 6aa55f8a67cb4eaf3dc3d9f448ed10633d7e67de..bc66c80b068d7fcd07352f69e1301c75317a1399 100644 (file)
@@ -44,7 +44,7 @@ class FilesController < ApplicationController
   end
 
   def new
-    @versions = @project.versions.sort
+    @versions = @project.versions.sorted
   end
 
   def create
index 820aa6c81a552eaffb1b03e3869ca363cf68063f..a43038a988c56b3386f8b024bfb5e42c29766853 100644 (file)
@@ -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
index cfef2f2001a3b2a24456b90b000a9a0237a0660f..a4ea33b6ff56038cb38ada2a8c047dddb7d99f1d 100644 (file)
@@ -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"
index 388c6ae0ab8fe4fe69a828eedea455dc195d5e7e..80d67cc241af38db2b94a8ea05d9f0bbc4cb84eb 100644 (file)
@@ -32,7 +32,7 @@
     <th style="width:15%"></th>
     </tr></thead>
   <tbody>
-<% @versions.sort.each do |version| %>
+<% @versions.each do |version| %>
     <tr class="version <%=h version.status %> <%= 'shared' if version.project != @project %>">
     <td class="name <%= 'icon icon-shared' if version.project != @project %>"><%= link_to_version version %></td>
     <td class="tick"><%= checked_image(version.id == @project.default_version_id) %></td>