From: Dagfinn Ilmari Mannsåker Date: Tue, 21 Apr 2009 03:34:04 +0000 (+0000) Subject: Use Class::C3::Componentised->load_optional_class X-Git-Tag: 0.04999_08~21 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ee1c392c08011a036c7d42de47941b56d24b47d8;p=dbsrgits%2FDBIx-Class-Schema-Loader.git Use Class::C3::Componentised->load_optional_class --- diff --git a/Makefile.PL b/Makefile.PL index a81c59e..f061211 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -19,7 +19,7 @@ requires 'Digest::MD5' => '2.36'; requires 'Class::Accessor::Fast' => '0.30'; requires 'Class::Data::Accessor' => '0.03'; requires 'Class::C3' => '0.18'; -requires 'Class::C3::Componentised' => 0; +requires 'Class::C3::Componentised' => '1.0005'; requires 'Carp::Clan' => 0; requires 'Class::Inspector' => 0; requires 'DBIx::Class' => '0.07006'; diff --git a/lib/DBIx/Class/Schema/Loader/DBI.pm b/lib/DBIx/Class/Schema/Loader/DBI.pm index a7d6ddf..098b0bf 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI.pm @@ -40,11 +40,9 @@ sub new { my $driver = $dbh->{Driver}->{Name}; my $subclass = 'DBIx::Class::Schema::Loader::DBI::' . $driver; - if ($self->ensure_class_found($subclass)) { - eval { $self->ensure_class_loaded($subclass) }; - croak "Failed to load $subclass: $@" if $@; + if ($self->load_optional_class($subclass)) { bless $self, $subclass unless $self->isa($subclass); - $self->_rebless(); + $self->_rebless; } # Set up the default quoting character and name seperators