Feature #32628 » 0001-Use-existing-scopes-instead-of-one-off-AR-condition.patch
app/models/issue_priority.rb | ||
---|---|---|
50 | 50 |
# Updates position_name for active priorities |
51 | 51 |
# Called from migration 20121026003537_populate_enumerations_position_name |
52 | 52 |
def self.compute_position_names |
53 |
priorities = where(:active => true).sort_by(&:position)
|
|
53 |
priorities = active
|
|
54 | 54 |
if priorities.any? |
55 | 55 |
default = priorities.detect(&:is_default?) || priorities[(priorities.size - 1) / 2] |
56 | 56 |
priorities.each_with_index do |priority, index| |