[Bps-public-commit] App-Changeloggr branch, master, updated. 3632d6ac9fb22c64d7d35a6da6a0f3b04d55416c

sartak at bestpractical.com sartak at bestpractical.com
Thu Jul 30 15:38:48 EDT 2009


The branch, master has been updated
       via  3632d6ac9fb22c64d7d35a6da6a0f3b04d55416c (commit)
      from  837bfc2636a38e50be4c8d88b3574b19d4477c67 (commit)

Summary of changes:
 lib/App/Changeloggr/Model/VoteCollection.pm |    4 ++++
 lib/App/Changeloggr/View/Leaderboard.pm     |    5 ++++-
 2 files changed, 8 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit 3632d6ac9fb22c64d7d35a6da6a0f3b04d55416c
Author: Shawn M Moore <sartak at gmail.com>
Date:   Thu Jul 30 15:38:35 2009 -0400

    Add vote count to the leaderboards

diff --git a/lib/App/Changeloggr/Model/VoteCollection.pm b/lib/App/Changeloggr/Model/VoteCollection.pm
index 4eeb042..1f3231b 100644
--- a/lib/App/Changeloggr/Model/VoteCollection.pm
+++ b/lib/App/Changeloggr/Model/VoteCollection.pm
@@ -19,6 +19,10 @@ sub group_by_voter {
     my $self = shift;
 
     $self->columns('user_id');
+    $self->column(
+        column   => 'id',
+        function => 'COUNT(*)',
+    );
 
     $self->group_by(
         column => 'user_id',
diff --git a/lib/App/Changeloggr/View/Leaderboard.pm b/lib/App/Changeloggr/View/Leaderboard.pm
index 4924c20..c37fccd 100644
--- a/lib/App/Changeloggr/View/Leaderboard.pm
+++ b/lib/App/Changeloggr/View/Leaderboard.pm
@@ -23,7 +23,10 @@ sub show_leaderboard {
         for (0 .. 25) {
             my $vote = $votes->next
                 or last;
-            li { $vote->user->name || 'anonymous' }
+            li {
+                my $name = $vote->user->name || 'anonymous';
+                outs _("%1 - %2", $name, $vote->id);
+            }
         }
     }
 }

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list