[Bps-public-commit] App-Changeloggr branch, master, updated. 282e6ec5b8065dd14d34f1ae9f5a28d5d099e34f

sartak at bestpractical.com sartak at bestpractical.com
Wed May 27 13:51:38 EDT 2009


The branch, master has been updated
       via  282e6ec5b8065dd14d34f1ae9f5a28d5d099e34f (commit)
      from  0f18e75d1a9143bc71fa78ab3882983c72d7fbbe (commit)

Summary of changes:
 lib/App/Changeloggr/Model/Change.pm |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

- Log -----------------------------------------------------------------
commit 282e6ec5b8065dd14d34f1ae9f5a28d5d099e34f
Author: Shawn M Moore <sartak at gmail.com>
Date:   Wed May 27 13:51:30 2009 -0400

    We're counting based on votes, not on tags

diff --git a/lib/App/Changeloggr/Model/Change.pm b/lib/App/Changeloggr/Model/Change.pm
index 523f631..38d024c 100644
--- a/lib/App/Changeloggr/Model/Change.pm
+++ b/lib/App/Changeloggr/Model/Change.pm
@@ -160,19 +160,20 @@ sub count_of_tag {
 
     my $text = ref($tag) ? $tag->text : $tag;
 
-    my $tags = $self->changelog->tags;
-    $tags->limit(
-        column   => 'text',
+    my $votes = $self->votes;
+    $votes->limit(
+        column   => 'tag',
         operator => '=',
         value    => $text,
     );
-    $tags->column(
+
+    $votes->column(
         column   => 'id',
-        function => 'count(main.text)',
+        function => 'count(main.tag)',
     );
-    $tags->order_by({});
+    $votes->order_by({});
 
-    return $tags->first->id;
+    return $votes->first->id;
 }
 
 1;

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



More information about the Bps-public-commit mailing list