Commit 9883381fce4f8e18b0a4d13b709c91a768d79052
1 parent
7a45e66f
Exists in
master
and in
1 other branch
Sort apps collection by number of unresolved errs (highest number first)
Showing
1 changed file
with
5 additions
and
0 deletions
Show diff stats
app/controllers/apps_controller.rb
@@ -44,6 +44,11 @@ class AppsController < InheritedResources::Base | @@ -44,6 +44,11 @@ class AppsController < InheritedResources::Base | ||
44 | end | 44 | end |
45 | 45 | ||
46 | protected | 46 | protected |
47 | + def collection | ||
48 | + # Sort apps by number of unresolved errs (highest number first) | ||
49 | + @apps ||= App.all.sort{|a,b| b.errs.unresolved.count <=> a.errs.unresolved.count } | ||
50 | + end | ||
51 | + | ||
47 | def initialize_subclassed_issue_tracker | 52 | def initialize_subclassed_issue_tracker |
48 | if params[:app][:issue_tracker_attributes] && tracker_type = params[:app][:issue_tracker_attributes][:type] | 53 | if params[:app][:issue_tracker_attributes] && tracker_type = params[:app][:issue_tracker_attributes][:type] |
49 | if IssueTracker.subclasses.map(&:name).concat(["IssueTracker"]).include?(tracker_type) | 54 | if IssueTracker.subclasses.map(&:name).concat(["IssueTracker"]).include?(tracker_type) |