use base qw/Class::Data::Inheritable/;
use DBIx::Class::Storage::DBI;
+use DBIx::Class::ClassResolver::PassThrough;
use DBI;
=head1 NAME
package MyDB;
use base qw/DBIx::Class/;
- __PACKAGE__->load_components('Core');
+ __PACKAGE__->load_components('DB');
__PACKAGE__->connection('dbi:...', 'user', 'pass', \%attrs);
package MyDB::MyTable;
use base qw/MyDB/;
+ __PACKAGE__->load_components('Core');
...
=cut
__PACKAGE__->mk_classdata('storage');
+__PACKAGE__->mk_classdata('class_resolver' =>
+ 'DBIx::Class::ClassResolver::PassThrough');
=item connection
sub dbi_rollback { $_[0]->storage->rollback; }
+sub resolve_class { return shift->class_resolver->class(@_); }
+
1;
=back
=head1 AUTHORS
-Matt S. Trout <perl-stuff@trout.me.uk>
+Matt S. Trout <mst@shadowcatsystems.co.uk>
=head1 LICENSE