From 478ce9ea3748afd1e9c10827a55a0d54680354b5 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Sun, 26 Apr 2015 11:49:08 -0400 Subject: [PATCH] Don't need to reverse --- app.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.rb b/app.rb index 02a06b4..179ec2d 100644 --- a/app.rb +++ b/app.rb @@ -12,7 +12,7 @@ get '/' do end leaders = Leader.all.includes(:last_attack, :last_defense) - @top20 = leaders.reject { |l| l.last_action } + leaders.select { |l| l.last_action }.sort_by { |l| l.last_action }.reverse + @top20 = leaders.reject { |l| l.last_action } + leaders.select { |l| l.last_action }.sort_by { |l| l.last_action } erb :index end