Having trouble with InstancePerContext in a schema. I'd like to be able to get 
at $c from within a schema definition. The $callsheet->context call does not 
throw an error and returns an undef value. So in the case below, I would expect 
console output to be 'good test' but instead I get "Can't call method "log" on 
an undefined value".

Thanks in advance for any guidance.

Steve Kleiman


> package Prodhub::Schema::Data::Project::CallsheetDB;
> 
> use strict;
> use warnings;
> 
> use base qw|DBIx::Class|;
> # use base qw|DBIx::Class Catalyst::Component::ACCEPT_CONTEXT|;
> use Moose;
> with 'Catalyst::Component::InstancePerContext';
> has 'context' => (is => 'ro');
> 
> sub build_per_context_instance {
>       my ($self, $c, @args) = @_;
>       return $self->new({ context => $c, %$self, @args });
> }
> 
> sub test {
>       my ( $callsheet ) = @_;
>       $callsheet->context->log->debug("good test");
> }


_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to