miscellaneous cleanup and removal of dead code
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Schema.pm
index 7926e92..c7214ca 100644 (file)
@@ -390,6 +390,8 @@ sub compose_namespace {
         $target_class => $source->result_class, ($base ? $base : ())
       );
       $source->result_class($target_class);
+      $target_class->result_source_instance($source)
+        if $target_class->can('result_source_instance');
     }
   }
   Class::C3->reinitialize();
@@ -555,6 +557,8 @@ context and it will behave as expected.
 sub txn_do {
   my ($self, $coderef, @args) = @_;
 
+  $self->storage or $self->throw_exception
+    ('txn_do called on $schema without storage');
   ref $coderef eq 'CODE' or $self->throw_exception
     ('$coderef must be a CODE reference');