C::M::DBIC::Schema - warn on create=dynamic, other cleanups, ::Role::Replicated ...
[catagits/Catalyst-Model-DBIC-Schema.git] / lib / Catalyst / Model / DBIC / Schema / Role / Caching.pm
index a821d06..ba374b5 100644 (file)
@@ -8,7 +8,7 @@ use namespace::clean -except => 'meta';
 =head1 NAME
 
 Catalyst::Model::DBIC::Schema::Role::Caching - Query caching support for
-DBIx::Class
+Catalyst::Model::DBIC::Schema
 
 =head1 SYNOPSIS
 
@@ -41,11 +41,9 @@ seconds you want the query results to be cached for, eg.:
 
   $c->model('DB::Table')->search({ foo => 'bar' }, { cache_for => 18000 });
 
-=bead1 CONFIG PARAMETERS
+=head1 CONFIG PARAMETERS
 
-=over 4
-
-=item caching
+=head2 caching
 
 Turn caching on or off, you can use:
 
@@ -53,8 +51,6 @@ Turn caching on or off, you can use:
 
 to disable caching at runtime.
 
-=back
-
 =cut
 
 has 'caching' => (is => 'rw', isa => 'Int', default => 1);
@@ -112,12 +108,10 @@ before ACCEPT_CONTEXT => sub {
 
 =head1 METHODS
 
-=over 4
-
-=item _reset_cursor_class
+=head2 _reset_cursor_class
 
 Reset the cursor class to L<DBIx::Class::Storage::DBI::Cursor> if it's set to
-L<DBIx::Class::Cursor::Cached>.
+L<DBIx::Class::Cursor::Cached>, if possible.
 
 =cut
 
@@ -125,14 +119,13 @@ sub _reset_cursor_class {
     my $self = shift;
 
     if ($self->connect_info->{cursor_class} eq 'DBIx::Class::Cursor::Cached') {
-        $self->storage->cursor_class('DBIx::Class::Storage::DBI::Cursor');
+        $self->storage->cursor_class('DBIx::Class::Storage::DBI::Cursor')
+            if $self->storage->can('cursor_class');
     }
     
     1;
 }
 
-=back
-
 =head1 SEE ALSO
 
 L<Catalyst::Model::DBIC::Schema>, L<DBIx::Class>, L<Catalyst::Plugin::Cache>,