- Throw clearer exception on ->new_related() with a non-existent
relationship.
- Fix t/storage/replicated.t class loading problem
+ - Stop using the deprecated Class::MOP::load_class()
* Misc
- Replace $row with $result in all docs to be consistent and to
use DBIx::Class::Admin::Types qw/DBICConnectInfo DBICHashRef/;
use MooseX::Types::JSON qw(JSON);
use MooseX::Types::Path::Class qw(Dir File);
+use MooseX::Types::LoadableClass qw(LoadableClass);
use Try::Tiny;
use JSON::Any qw(DWIW XS JSON);
use namespace::autoclean;
has 'schema_class' => (
is => 'ro',
- isa => Str,
+ isa => LoadableClass,
);
sub _build_schema {
my ($self) = @_;
- require Class::MOP;
- Class::MOP::load_class($self->schema_class);
$self->connect_info->[3]{ignore_version} = 1;
return $self->schema_class->connect(@{$self->connect_info});
}
my $moose_basic = {
'Moose' => '0.98',
'MooseX::Types' => '0.21',
+ 'MooseX::Types::LoadableClass' => '0.011',
};
my $replicated = {
use MooseX::Types
-declare => [qw/BalancerClassNamePart Weight DBICSchema DBICStorageDBI/];
use MooseX::Types::Moose qw/ClassName Str Num/;
+use MooseX::Types::LoadableClass qw/LoadableClass/;
class_type 'DBIx::Class::Storage::DBI';
class_type 'DBIx::Class::Schema';
subtype DBICStorageDBI, as 'DBIx::Class::Storage::DBI';
subtype BalancerClassNamePart,
- as ClassName;
+ as LoadableClass;
coerce BalancerClassNamePart,
from Str,
via {
my $type = $_;
- if($type=~m/^::/) {
- $type = 'DBIx::Class::Storage::DBI::Replicated::Balancer'.$type;
- }
- Class::MOP::load_class($type);
+ $type =~ s/\A::/DBIx::Class::Storage::DBI::Replicated::Balancer::/;
$type;
};