fix case where repelicant coderef dsn does not connect
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / Replicated / WithDSN.pm
index a6fe522..7cab9a9 100644 (file)
@@ -41,6 +41,9 @@ around '_query_start' => sub {
     if ((reftype($dsn)||'') ne 'CODE') {
       "$op [DSN_$storage_type=$dsn]$rest";
     }
+    elsif (my $id = eval { $self->id }) {
+      "$op [$storage_type=$id]$rest";
+    }
     else {
       "$op [$storage_type]$rest";
     }