Mercurial > hg > soundsoftware-site
diff app/models/issue_priority.rb @ 1517:dffacf8a6908 redmine-2.5
Update to Redmine SVN revision 13367 on 2.5-stable branch
author | Chris Cannam |
---|---|
date | Tue, 09 Sep 2014 09:29:00 +0100 |
parents | e248c7af89ec |
children |
line wrap: on
line diff
--- a/app/models/issue_priority.rb Tue Sep 09 09:28:31 2014 +0100 +++ b/app/models/issue_priority.rb Tue Sep 09 09:29:00 2014 +0100 @@ -48,7 +48,7 @@ # 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| @@ -61,7 +61,7 @@ index == (priorities.size - 1) ? "highest" : "high#{priorities.size - index}" end - update_all({:position_name => name}, :id => priority.id) + where(:id => priority.id).update_all({:position_name => name}) end end end