summaryrefslogtreecommitdiffstats
path: root/app/helpers/versions_helper.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-30 14:24:33 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-30 14:24:33 +0000
commitf909a8c006d01e8b500ef8ffc9963bdf81662faf (patch)
treef66a4a8b49173fd750b6e7d177e7475876942795 /app/helpers/versions_helper.rb
parent399223daba6f993775fe783828b6612747e7a89f (diff)
downloadredmine-f909a8c006d01e8b500ef8ffc9963bdf81662faf.tar.gz
redmine-f909a8c006d01e8b500ef8ffc9963bdf81662faf.zip
Issues by Category should show tasks without category (#8106).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10771 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/versions_helper.rb')
-rw-r--r--app/helpers/versions_helper.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/helpers/versions_helper.rb b/app/helpers/versions_helper.rb
index 91dec8e91..91082380c 100644
--- a/app/helpers/versions_helper.rb
+++ b/app/helpers/versions_helper.rb
@@ -44,7 +44,8 @@ module VersionsHelper
rescue ActiveRecord::RecordNotFound
# When grouping by an association, Rails throws this exception if there's no result (bug)
end
- counts = h.keys.compact.sort.collect {|k| {:group => k, :total => h[k][0], :open => h[k][1], :closed => (h[k][0] - h[k][1])}}
+ # Sort with nil keys in last position
+ counts = h.keys.sort {|a,b| a.nil? ? 1 : (b.nil? ? -1 : a <=> b)}.collect {|k| {:group => k, :total => h[k][0], :open => h[k][1], :closed => (h[k][0] - h[k][1])}}
max = counts.collect {|c| c[:total]}.max
render :partial => 'issue_counts', :locals => {:version => version, :criteria => criteria, :counts => counts, :max => max}