Factor out remote relname for back-compat overridability
[dbsrgits/DBIx-Class-Schema-Loader.git] / lib / DBIx / Class / Schema / Loader.pm
index 0c3b2a5..edc3df3 100644 (file)
@@ -4,14 +4,13 @@ use strict;
 use warnings;
 use base qw/DBIx::Class::Schema Class::Data::Accessor/;
 use Carp::Clan qw/^DBIx::Class/;
-use UNIVERSAL::require;
 use Class::C3;
 use Scalar::Util qw/ weaken /;
 
 # Always remember to do all digits for the version even if they're 0
 # i.e. first release of 0.XX *must* be 0.XX000. This avoids fBSD ports
 # brain damage and presumably various other packaging systems too
-our $VERSION = '0.04999_06';
+our $VERSION = '0.04999_07';
 
 __PACKAGE__->mk_classaccessor('_loader_args' => {});
 __PACKAGE__->mk_classaccessors(qw/dump_to_dir _loader_invoked _loader loader_class/);
@@ -131,9 +130,8 @@ sub _invoke_loader {
     my $impl = $self->loader_class
       || "DBIx::Class::Schema::Loader" . $self->storage_type;
     $impl = "DBIx::Class::Schema::Loader${impl}" if $impl =~ /^::/;
-    $impl->require or
-      croak qq/Could not load storage_type loader "$impl": / .
-            qq/"$UNIVERSAL::require::ERROR"/;
+    eval { $self->ensure_class_loaded($impl) };
+    croak qq/Could not load storage_type loader "$impl": "$@"/ if $@;
 
     $self->_loader($impl->new(%$args));
     $self->_loader->load;