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

Alex M Vandiver alexmv at bestpractical.com
Tue Mar 31 15:09:50 EDT 2009


The branch, master has been updated
       via  f31574708db8bc26525b3b1cb1bcc603ae786e94 (commit)
       via  991bf82e4436d53bd300a8cc8f8497f3d4b8025d (commit)
       via  ca8adce3309143a45d43cf8a8d2fd57d9ff9a94b (commit)
      from  e7b40dcf95bbd0d9f0f9ef6e9995daa8acb73e12 (commit)

Summary of changes:
 lib/App/Changeloggr/Model/ChangeCollection.pm |    3 ++-
 lib/App/Changeloggr/Model/Vote.pm             |    2 +-
 lib/App/Changeloggr/Model/VoteCollection.pm   |    9 +++++++++
 lib/App/Changeloggr/View.pm                   |    8 +++++---
 4 files changed, 17 insertions(+), 5 deletions(-)
 create mode 100644 lib/App/Changeloggr/Model/VoteCollection.pm

- Log -----------------------------------------------------------------
commit ca8adce3309143a45d43cf8a8d2fd57d9ff9a94b
Author: Alex Vandiver <alexmv at mit.edu>
Date:   Tue Mar 31 14:37:05 2009 -0400

    Make Votes and Changes all readable, to skip read ACLS on load

diff --git a/lib/App/Changeloggr/Model/ChangeCollection.pm b/lib/App/Changeloggr/Model/ChangeCollection.pm
index 81fff28..1aebe78 100644
--- a/lib/App/Changeloggr/Model/ChangeCollection.pm
+++ b/lib/App/Changeloggr/Model/ChangeCollection.pm
@@ -3,7 +3,8 @@ use strict;
 use warnings;
 use base 'App::Changeloggr::Collection';
 use Params::Validate qw(validate SCALAR);
-use DateTime::Format::Strptime;
+
+use constant results_are_readable => 1;
 
 sub create_from_text {
     my $self = shift;
diff --git a/lib/App/Changeloggr/Model/VoteCollection.pm b/lib/App/Changeloggr/Model/VoteCollection.pm
new file mode 100644
index 0000000..310212d
--- /dev/null
+++ b/lib/App/Changeloggr/Model/VoteCollection.pm
@@ -0,0 +1,9 @@
+package App::Changeloggr::Model::VoteCollection;
+use strict;
+use warnings;
+use base 'App::Changeloggr::Collection';
+
+use constant results_are_readable => 1;
+
+1;
+

commit 991bf82e4436d53bd300a8cc8f8497f3d4b8025d
Author: Alex Vandiver <alexmv at mit.edu>
Date:   Tue Mar 31 15:08:49 2009 -0400

    Vote->change can't be protected, as then it isn't available to create actions

diff --git a/lib/App/Changeloggr/Model/Vote.pm b/lib/App/Changeloggr/Model/Vote.pm
index b86aed4..2eaf0ab 100644
--- a/lib/App/Changeloggr/Model/Vote.pm
+++ b/lib/App/Changeloggr/Model/Vote.pm
@@ -10,7 +10,7 @@ use App::Changeloggr::Record schema {
         refers_to App::Changeloggr::Model::Change,
         is mandatory,
         is immutable,
-        is protected;
+        render as 'hidden';
 
     column user_session_id =>
         type is 'text',

commit f31574708db8bc26525b3b1cb1bcc603ae786e94
Author: Alex Vandiver <alexmv at mit.edu>
Date:   Tue Mar 31 15:09:27 2009 -0400

    Hand CreateVote the right value for change

diff --git a/lib/App/Changeloggr/View.pm b/lib/App/Changeloggr/View.pm
index a62910a..f9e6241 100644
--- a/lib/App/Changeloggr/View.pm
+++ b/lib/App/Changeloggr/View.pm
@@ -108,10 +108,12 @@ sub show_change {
 sub show_vote_form {
     my $change = shift;
 
+
     form {
-        my $vote = App::Changeloggr::Action::CreateVote->new;
-        render_action $vote;
-        form_submit(label => 'Vote');
+        my $vote = App::Changeloggr::Action::CreateVote->new(
+            arguments => { change => $change } );
+        render_action $vote ;
+        form_submit( label => 'Vote' );
     }
 }
 

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



More information about the Bps-public-commit mailing list