From: Rafael Kitover Date: Sat, 22 Oct 2011 16:01:04 +0000 (-0400) Subject: add POD for PerRequestSchema trait X-Git-Tag: v0.57~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Model-DBIC-Schema.git;a=commitdiff_plain;h=63dcfadb4e682ef2833b477fd24628c9db88ccf0 add POD for PerRequestSchema trait --- diff --git a/Changes b/Changes index a56b3fa..0e16509 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ Revision history for Perl extension Catalyst::Model::DBIC::Schema + - add POD for PerRequestSchema trait + 0.56 2011-10-22 15:34:59 - add PerRequestSchema trait (t0m) diff --git a/lib/Catalyst/TraitFor/Model/DBIC/Schema/PerRequestSchema.pm b/lib/Catalyst/TraitFor/Model/DBIC/Schema/PerRequestSchema.pm index df254b3..cdf00ee 100644 --- a/lib/Catalyst/TraitFor/Model/DBIC/Schema/PerRequestSchema.pm +++ b/lib/Catalyst/TraitFor/Model/DBIC/Schema/PerRequestSchema.pm @@ -1,4 +1,5 @@ package Catalyst::TraitFor::Model::DBIC::Schema::PerRequestSchema; + use Moose::Role; use namespace::autoclean; @@ -6,6 +7,29 @@ requires 'per_request_schema_attributes'; with 'Catalyst::Component::InstancePerContext'; +=head1 NAME + +Catalyst::TraitFor::Model::DBIC::Schema::PerRequestSchema - Clone the schema +with attributes for each requests + +=head1 SYNOPSIS + + __PACKAGE__->config({ + traits => ['PerRequestSchema'], + }); + + method per_request_schema_attributes($c) { + return (restricting_object => $c->user->obj); + } + +=head1 DESCRIPTION + +Clones the schema for each new request with the attributes retrieved from your +C method, which you must implement. This method +is passed the context. + +=cut + sub build_per_context_instance { my ( $self, $ctx ) = @_; return $self unless blessed($ctx); @@ -19,3 +43,24 @@ sub build_per_context_instance { __PACKAGE__->meta->make_immutable; +=head1 SEE ALSO + +L, L + +=head1 AUTHOR + +See L and +L. + +=head1 COPYRIGHT + +See L. + +=head1 LICENSE + +This program is free software, you can redistribute it and/or modify it +under the same terms as Perl itself. + +=cut + +1;