[Catalyst-commits] r13275 - in trunk/Catalyst-Plugin-Cache: . lib/Catalyst/Plugin

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Thu May 20 16:47:27 GMT 2010


Author: t0m
Date: 2010-05-20 17:47:27 +0100 (Thu, 20 May 2010)
New Revision: 13275

Modified:
   trunk/Catalyst-Plugin-Cache/Changes
   trunk/Catalyst-Plugin-Cache/lib/Catalyst/Plugin/Cache.pm
Log:
Fix bug, I think

Modified: trunk/Catalyst-Plugin-Cache/Changes
===================================================================
--- trunk/Catalyst-Plugin-Cache/Changes	2010-05-20 16:38:24 UTC (rev 13274)
+++ trunk/Catalyst-Plugin-Cache/Changes	2010-05-20 16:47:27 UTC (rev 13275)
@@ -1,3 +1,10 @@
+        - Change to Module::Install
+        - Drop test dep on ok
+        - Split requires and test_requires
+        - Fix bug when used in conjunction with ::Model::DBIC::Schema
+          Caching trait by not trying to cache the curried cache instance when
+          we don't have a request instance to cache it against
+
 0.09
         - Generate a warning if no config is specified, or config
           is specified using the old key.

Modified: trunk/Catalyst-Plugin-Cache/lib/Catalyst/Plugin/Cache.pm
===================================================================
--- trunk/Catalyst-Plugin-Cache/lib/Catalyst/Plugin/Cache.pm	2010-05-20 16:38:24 UTC (rev 13274)
+++ trunk/Catalyst-Plugin-Cache/lib/Catalyst/Plugin/Cache.pm	2010-05-20 16:47:27 UTC (rev 13275)
@@ -12,7 +12,7 @@
 use Catalyst::Utils ();
 use Carp ();
 use MRO::Compat;
-
+use Scalar::Util qw/ blessed /;
 use Catalyst::Plugin::Cache::Curried;
 
 __PACKAGE__->mk_classdata( "_cache_backends" );
@@ -154,7 +154,7 @@
     if ( @meta == 1 ) {
         my $name = $meta[0];
         return ( $c->get_preset_curried($name) || $c->get_cache_backend($name) );
-    } elsif ( !@meta ) {
+    } elsif ( !@meta && blessed $c ) {
         # be nice and always return the same one for the simplest case
         return ( $c->_default_curried_cache || $c->_default_curried_cache( $c->curry_cache( @meta ) ) );
     } else {




More information about the Catalyst-commits mailing list