Project

General

Profile

Feature #32628 » 0001-Use-existing-scopes-instead-of-one-off-AR-condition.patch

Jan from Planio www.plan.io, 2020-01-07 06:23

View differences:

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|
(1-1/5)