Quoting Matt S Trout <[EMAIL PROTECTED]>:
> # in MyApp::Model::Schema (which ISA Catalyst::Model::DBIC::Schema)
> sub new {
>   my $self = shift->NEXT::new(@_);
>   my ($app, $config) = @_;
>   $self->schema->default_resultset_attributes( {
>     cache_object => $app->cache
>   } );
>   return $self;
> }
> Above is going to be more easily reusable.
> The Takkle setup (for which Cursor::Cached was originally written, thanks
> to them for sponsoring my work on it) also checks a $app->config key to
> decide whether to use the app cache so we can keep sessions in memcache
> but use Cache::Null for the DBIC stuff during testing.

Thanks, Matt! I'd be happy to write up a small doc patch for this.
Maybe in a new section "Model Caching" in Catalyst::Manual::Cookbook?

--Tobias

_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to