[Bps-public-commit] App-Changeloggr branch, master, updated. 20a2a7d43539e5b5a553fab9c221e8486ee004c5

sartak at bestpractical.com sartak at bestpractical.com
Thu Aug 13 21:50:11 EDT 2009


The branch, master has been updated
       via  20a2a7d43539e5b5a553fab9c221e8486ee004c5 (commit)
      from  8751705f9e573ecead7b87d7586c30c1a30e828b (commit)

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

- Log -----------------------------------------------------------------
commit 20a2a7d43539e5b5a553fab9c221e8486ee004c5
Author: Shawn M Moore <sartak at gmail.com>
Date:   Thu Aug 13 21:50:00 2009 -0400

    Change->vote(text)

diff --git a/lib/App/Changeloggr/Model/Change.pm b/lib/App/Changeloggr/Model/Change.pm
index 930f86f..85ea3cf 100644
--- a/lib/App/Changeloggr/Model/Change.pm
+++ b/lib/App/Changeloggr/Model/Change.pm
@@ -198,5 +198,21 @@ sub count_of_tag {
     return $votes->first->id;
 }
 
+sub vote {
+    my $self = shift;
+    my $text = shift;
+
+    my $vote = Jifty->web->new_action(
+        class     => 'CreateVote',
+        change_id => $self->id,
+        tag       => $text,
+    );
+
+    $vote->validate or return;
+    $vote->run;
+    return $vote->result;
+
+}
+
 1;
 

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



More information about the Bps-public-commit mailing list