load external classes for dynamic schemas only
Rafael Kitover [Mon, 30 Nov 2009 00:18:50 +0000 (00:18 +0000)]
lib/DBIx/Class/Schema/Loader/Base.pm
t/lib/dbixcsl_common_tests.pm

index e8ee87b..6cd8368 100644 (file)
@@ -438,13 +438,12 @@ sub _load_external {
     close($fh)
         or croak "Failed to close $real_inc_path: $!";
 
-# load the class too
-    {
+    if ($self->dynamic) { # load the class too
         # turn off redefined warnings
-        $SIG{__WARN__} = sub {};
+        local $SIG{__WARN__} = sub {};
         do $real_inc_path;
+        die $@ if $@;
     }
-    die $@ if $@;
 }
 
 =head2 load
index c15d322..c7a78de 100644 (file)
@@ -134,7 +134,7 @@ sub setup_schema {
 
        exit if $file_count != $expected_count;
 
-       my $warn_count = 0;
+       my $warn_count = 2;
        $warn_count++ if grep /ResultSetManager/, @loader_warnings;
 
         if($self->{skip_rels}) {