summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2020-01-21 04:02:53 +0000
committerGo MAEDA <maeda@farend.jp>2020-01-21 04:02:53 +0000
commit758a08fad9c9da5a8378bcde2cd29608b6127741 (patch)
treea2d834ce31e7a5be5dd8dcf6e3ea89c568a60e73
parent571e47061ac38e11cb56a03273de2e9d215e743d (diff)
downloadredmine-758a08fad9c9da5a8378bcde2cd29608b6127741.tar.gz
redmine-758a08fad9c9da5a8378bcde2cd29608b6127741.zip
Use existing scopes instead of one-off AR condition (#32628).
Patch by Jan Schulz-Hofen. git-svn-id: http://svn.redmine.org/redmine/trunk@19446 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/models/issue_priority.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/issue_priority.rb b/app/models/issue_priority.rb
index 106754293..05be79dd1 100644
--- a/app/models/issue_priority.rb
+++ b/app/models/issue_priority.rb
@@ -50,7 +50,7 @@ class IssuePriority < Enumeration
# Updates position_name for active priorities
# Called from migration 20121026003537_populate_enumerations_position_name
def self.compute_position_names
- priorities = where(:active => true).sort_by(&:position)
+ priorities = active
if priorities.any?
default = priorities.detect(&:is_default?) || priorities[(priorities.size - 1) / 2]
priorities.each_with_index do |priority, index|