remove unneeded Relation#all from IssuePriority model

git-svn-id: http://svn.redmine.org/redmine/trunk@12722 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2014-01-27 01:08:54 +00:00
parent 077598fe4b
commit ca3d706f56
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ class IssuePriority < Enumeration
# Updates position_name for active priorities # Updates position_name for active priorities
# Called from migration 20121026003537_populate_enumerations_position_name # Called from migration 20121026003537_populate_enumerations_position_name
def self.compute_position_names def self.compute_position_names
priorities = where(:active => true).all.sort_by(&:position) priorities = where(:active => true).sort_by(&:position)
if priorities.any? if priorities.any?
default = priorities.detect(&:is_default?) || priorities[(priorities.size - 1) / 2] default = priorities.detect(&:is_default?) || priorities[(priorities.size - 1) / 2]
priorities.each_with_index do |priority, index| priorities.each_with_index do |priority, index|