package TopTable::Model::DB; use strict; use base 'Catalyst::Model::DBIC::Schema'; __PACKAGE__->config( schema_class => 'TopTable::Schema', connect_info => { dsn => 'dbi:mysql:toptable', user => '', password => '', } ); use TopTable::Maketext; sub ACCEPT_CONTEXT { my ( $self, $c ) = @_; # We have to check the ref of $c here because this model seems to get called by Catalyst as part of the instantiation, before my code kicks in # and in these cases, $c is the string "TopTable", not a ref to the TopTable object. $self->schema->_set_maketext( TopTable::Maketext->get_handle( $c->locale ) ) if ref( $c ) eq "TopTable"; return $self; } 1;