Switched to using Catalyst::Component::InstancePerContext for the Model per t0m's...
broquaint [Tue, 27 Oct 2009 13:58:22 +0000 (13:58 +0000)]
lib/Gitalist/Model/Git.pm

index f62dc5b..67e7294 100644 (file)
@@ -3,7 +3,8 @@ package Gitalist::Model::Git;
 use Moose;
 use namespace::autoclean;
 
-BEGIN { extends 'Catalyst::Model' }
+extends 'Catalyst::Model';
+with 'Catalyst::Component::InstancePerContext';
 
 use DateTime;
 use Path::Class;
@@ -40,7 +41,7 @@ has git      => ( isa => NonEmptySimpleStr, is => 'ro', lazy_build => 1 );
 has project  => ( isa => NonEmptySimpleStr, is => 'rw');
 has gpp      => ( isa => 'Git::PurePerl',   is => 'rw', lazy_build => 1 );
 
-sub ACCEPT_CONTEXT {
+sub build_per_context_instance {
   my ( $self, $c ) = @_;
   
   $self->project( $c->req->param('p') );