From: Toshi MARUYAMA Date: Mon, 27 Jan 2014 01:08:54 +0000 (+0000) Subject: remove unneeded Relation#all from IssuePriority model X-Git-Tag: 2.5.0~178 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ca3d706f56b90958e3b451e7fda04eee52ca2c1e;p=redmine.git remove unneeded Relation#all from IssuePriority model git-svn-id: http://svn.redmine.org/redmine/trunk@12722 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/issue_priority.rb b/app/models/issue_priority.rb index d07baa6b6..95b120d7a 100644 --- a/app/models/issue_priority.rb +++ b/app/models/issue_priority.rb @@ -48,7 +48,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).all.sort_by(&:position) + priorities = where(:active => true).sort_by(&:position) if priorities.any? default = priorities.detect(&:is_default?) || priorities[(priorities.size - 1) / 2] priorities.each_with_index do |priority, index|