add POD for PerRequestSchema trait
Rafael Kitover [Sat, 22 Oct 2011 16:01:04 +0000 (12:01 -0400)]
Changes
lib/Catalyst/TraitFor/Model/DBIC/Schema/PerRequestSchema.pm

diff --git a/Changes b/Changes
index a56b3fa..0e16509 100644 (file)
--- 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)
 
index df254b3..cdf00ee 100644 (file)
@@ -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<per_request_schema_attributes> 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<Catalyst::Model::DBIC::Schema>, L<DBIx::Class::Schema>
+
+=head1 AUTHOR
+
+See L<Catalyst::Model::DBIC::Schema/AUTHOR> and
+L<Catalyst::Model::DBIC::Schema/CONTRIBUTORS>.
+
+=head1 COPYRIGHT
+
+See L<Catalyst::Model::DBIC::Schema/COPYRIGHT>.
+
+=head1 LICENSE
+
+This program is free software, you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
+=cut
+
+1;