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

sartak at bestpractical.com sartak at bestpractical.com
Tue Mar 31 18:17:52 EDT 2009


The branch, master has been updated
       via  c081d433491c935ada78a91e984f3ba2af7cf08f (commit)
       via  7506e187d4d5c7c5146bed2535924b55a7816df8 (commit)
      from  a3602d88dd78d8ce071a64eaf345de4486aa6197 (commit)

Summary of changes:
 lib/App/Changeloggr/Model/Changelog.pm |    4 +++-
 lib/App/Changeloggr/Model/Tag.pm       |   32 ++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 1 deletions(-)
 create mode 100644 lib/App/Changeloggr/Model/Tag.pm

- Log -----------------------------------------------------------------
commit 7506e187d4d5c7c5146bed2535924b55a7816df8
Author: Shawn M Moore <sartak at gmail.com>
Date:   Tue Mar 31 17:46:43 2009 -0400

    JiftyX::ModelHelpers has to go below schema

diff --git a/lib/App/Changeloggr/Model/Changelog.pm b/lib/App/Changeloggr/Model/Changelog.pm
index 8892dad..fe66d4e 100644
--- a/lib/App/Changeloggr/Model/Changelog.pm
+++ b/lib/App/Changeloggr/Model/Changelog.pm
@@ -3,7 +3,6 @@ use warnings;
 
 package App::Changeloggr::Model::Changelog;
 use Jifty::DBI::Schema;
-use JiftyX::ModelHelpers;
 
 use App::Changeloggr::Record schema {
     column name =>
@@ -23,6 +22,9 @@ use App::Changeloggr::Record schema {
         default is defer { _generate_admin_token() };
 };
 
+# has to go below schema
+use JiftyX::ModelHelpers;
+
 sub _generate_admin_token {
     require Data::GUID;
     Data::GUID->new->as_string;

commit c081d433491c935ada78a91e984f3ba2af7cf08f
Author: Shawn M Moore <sartak at gmail.com>
Date:   Tue Mar 31 17:46:56 2009 -0400

    Add a Tag class

diff --git a/lib/App/Changeloggr/Model/Tag.pm b/lib/App/Changeloggr/Model/Tag.pm
new file mode 100644
index 0000000..6867c1b
--- /dev/null
+++ b/lib/App/Changeloggr/Model/Tag.pm
@@ -0,0 +1,32 @@
+use strict;
+use warnings;
+
+package App::Changeloggr::Model::Tag;
+use Jifty::DBI::Schema;
+
+use App::Changeloggr::Record schema {
+    column changelog =>
+        refers_to App::Changeloggr::Model::Changelog,
+        is mandatory,
+        is immutable;
+
+    column text =>
+        type is 'text',
+        label is 'Raw',
+        is mandatory,
+        is immutable;
+};
+
+sub current_user_can {
+    my $self  = shift;
+    my $right = shift;
+
+    # anyone can read a tag
+    return 1 if $right eq 'read';
+
+    return $self->SUPER::current_user_can($right, @_);
+}
+
+
+1;
+

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



More information about the Bps-public-commit mailing list