Use Class::C3::Componentised->load_optional_class
Dagfinn Ilmari Mannsåker [Tue, 21 Apr 2009 03:34:04 +0000 (03:34 +0000)]
Makefile.PL
lib/DBIx/Class/Schema/Loader/DBI.pm

index a81c59e..f061211 100644 (file)
@@ -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';
index a7d6ddf..098b0bf 100644 (file)
@@ -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