X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FModel%2FDBIC%2FSchema%2FRole%2FCaching.pm;h=ba374b501c5b8afdb758b0c0a3d363da6dff67e0;hb=c4fee9b88f9183e17c6499c077fcf8572a95c165;hp=a821d063c7aacfc979d106ea14f50075b1dea514;hpb=fdd5f3df7e5b59b0759aee7896b63837c2a926b1;p=catagits%2FCatalyst-Model-DBIC-Schema.git diff --git a/lib/Catalyst/Model/DBIC/Schema/Role/Caching.pm b/lib/Catalyst/Model/DBIC/Schema/Role/Caching.pm index a821d06..ba374b5 100644 --- a/lib/Catalyst/Model/DBIC/Schema/Role/Caching.pm +++ b/lib/Catalyst/Model/DBIC/Schema/Role/Caching.pm @@ -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 if it's set to -L. +L, 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, L, L,