mirror of
https://github.com/meineerde/redmine.git
synced 2026-02-01 03:57:15 +00:00
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
This commit is contained in:
parent
571e47061a
commit
758a08fad9
@ -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|
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user