Subject: | $class->isa called before $class is loaded. |
Catalyst::TraitFor::Model::DBIC::Schema::Replicated does this:
# check storage_type compatibility (if configured)
if (my $storage_type = $self->storage_type) {
my $class = $storage_type =~ /^::/ ?
"DBIx::Class::Storage$storage_type"
: $storage_type;
croak "This storage_type cannot be used with replication"
unless $class->isa('DBIx::Class::Storage::DBI::Replicated');
} else {
$self->storage_type('::DBI::Replicated');
}
But DBIx::Class::Schema does not load the storage_type class until
$schema->connection is called. So if you have a custom storage_type
that is not loaded by other means then the above code will croak.
I suspect Calling Class::MOP::load_class( $class ) should be done before
calling isa on $class.