summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2024-08-13 01:34:16 +0000
committerGo MAEDA <maeda@farend.jp>2024-08-13 01:34:16 +0000
commitcac20eef425071d85d18d424b0766fc83ac5b0dd (patch)
treeb72e9322fd811603274f333efc8ab8073ed87355 /app
parente7980d7f4c3574a12b3918910f6de837111afd4b (diff)
downloadredmine-cac20eef425071d85d18d424b0766fc83ac5b0dd.tar.gz
redmine-cac20eef425071d85d18d424b0766fc83ac5b0dd.zip
Merged r22947 and r22948 from trunk to 5.1-stable (#41079).
git-svn-id: https://svn.redmine.org/redmine/branches/5.1-stable@22957 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/models/query.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/query.rb b/app/models/query.rb
index fcd2c9e95..980976e5f 100644
--- a/app/models/query.rb
+++ b/app/models/query.rb
@@ -618,7 +618,7 @@ class Query < ActiveRecord::Base
author_values = []
author_values << ["<< #{l(:label_me)} >>", "me"] if User.current.logged?
author_values +=
- users.sort_by(&:status).
+ users.sort_by{|p| [p.status, p]}.
collect{|s| [s.name, s.id.to_s, l("status_#{User::LABEL_BY_STATUS[s.status]}")]}
author_values << [l(:label_user_anonymous), User.anonymous.id.to_s]
author_values
@@ -628,7 +628,7 @@ class Query < ActiveRecord::Base
assigned_to_values = []
assigned_to_values << ["<< #{l(:label_me)} >>", "me"] if User.current.logged?
assigned_to_values +=
- (Setting.issue_group_assignment? ? principals : users).sort_by(&:status).
+ (Setting.issue_group_assignment? ? principals : users).sort_by{|p| [p.status, p]}.
collect{|s| [s.name, s.id.to_s, l("status_#{User::LABEL_BY_STATUS[s.status]}")]}
assigned_to_values
end
@@ -658,7 +658,7 @@ class Query < ActiveRecord::Base
watcher_values = [["<< #{l(:label_me)} >>", "me"]]
if User.current.allowed_to?(:view_issue_watchers, self.project, global: true)
watcher_values +=
- principals.sort_by(&:status).
+ principals.sort_by{|p| [p.status, p]}.
collect{|s| [s.name, s.id.to_s, l("status_#{User::LABEL_BY_STATUS[s.status]}")]}
end
watcher_values