Tobias Kremer <[EMAIL PROTECTED]> writes:

> Quoting Tobias Kremer <[EMAIL PROTECTED]>:
>> Realizing that MyApp::Model::Schema is already just a subclass of
>> C::M::DBIC::Schema (doh!) I came up with the following solution that just
>> overrides new():
>
> Hmmm ... Could somebody take a look at the following version I came up with
> and tell me if using Urbia2->cache (from Catalyst::Plugin::Cache::Memcached)
> in this context is okay:
>
> # in MyApp::Model::Schema (which ISA Catalyst::Model::DBIC::Schema)
> sub new {
>   my $self = shift->NEXT::new(@_);
>   $self->schema->default_resultset_attributes( {
>     cache_object => Urbia2->cache
>   } );
>   return $self;
> }

I have a feeling that "cache" isn't a static method; you'll need $c in
order to call it.  In that case, you'll have to fixup the default
ResultSet attributes after setup or in ACCEPT_CONTEXT.

If "Urbia2->cache" works, though, then I'm wrong :)  Let us know; I
have a few ideas if what you've written above doesn't work.

Regards,
Jonathan Rockway

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

Reply via email to