##// END OF EJS Templates
remove unneeded Relation#all from IssuePriority model...
Toshi MARUYAMA -
r12447:ca3d706f56b9
parent child
Show More
@@ -48,7 +48,7 class IssuePriority < Enumeration
48 # Updates position_name for active priorities
48 # Updates position_name for active priorities
49 # Called from migration 20121026003537_populate_enumerations_position_name
49 # Called from migration 20121026003537_populate_enumerations_position_name
50 def self.compute_position_names
50 def self.compute_position_names
51 priorities = where(:active => true).all.sort_by(&:position)
51 priorities = where(:active => true).sort_by(&:position)
52 if priorities.any?
52 if priorities.any?
53 default = priorities.detect(&:is_default?) || priorities[(priorities.size - 1) / 2]
53 default = priorities.detect(&:is_default?) || priorities[(priorities.size - 1) / 2]
54 priorities.each_with_index do |priority, index|
54 priorities.each_with_index do |priority, index|
General Comments 0
You need to be logged in to leave comments. Login now