From fc1daf997808942d64a22ee048d2712dae9e41eb Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Mon, 4 Jun 2012 17:40:57 +1200 Subject: [PATCH] Fixed sorting for Apps index table --- app/controllers/apps_controller.rb | 4 +--- app/views/apps/index.html.haml | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/controllers/apps_controller.rb b/app/controllers/apps_controller.rb index b59902f..4bde84a 100644 --- a/app/controllers/apps_controller.rb +++ b/app/controllers/apps_controller.rb @@ -61,12 +61,10 @@ class AppsController < InheritedResources::Base end # Sort apps by number of unresolved errs, then problem counts. - apps.sort! do |a,b| + apps.sort do |a,b| unresolved = @unresolved_counts[b.id] <=> @unresolved_counts[a.id] unresolved != 0 ? unresolved : @problem_counts[b.id] <=> @problem_counts[a.id] end - - apps end end diff --git a/app/views/apps/index.html.haml b/app/views/apps/index.html.haml index dc9923b..f3e05b6 100644 --- a/app/views/apps/index.html.haml +++ b/app/views/apps/index.html.haml @@ -36,7 +36,7 @@ = link_to( app.last_deploy_at.to_s(:micro) << (revision.present? ? " (#{revision})" : ""), app_deploys_path(app)) %td.count - if @problem_counts[app.id] > 0 - - unresolved = @unresolved_counts[app.id] || app.problems.unresolved.count + - unresolved = @unresolved_counts[app.id] = link_to unresolved, app_path(app), :class => (unresolved == 0 ? "resolved" : nil) - if @apps.none? %tr -- libgit2 0.21.2