make sure debugobj calls always go to the master
John Napiorkowski [Thu, 10 Jul 2008 21:14:04 +0000 (21:14 +0000)]
lib/DBIx/Class/Storage/DBI/Replicated/Replicant.pm

index 32d3c2c..b766bed 100644 (file)
@@ -1,6 +1,7 @@
 package DBIx::Class::Storage::DBI::Replicated::Replicant;
 
 use Moose::Role;
+requires qw/_query_start/;
 
 =head1 NAME
 
@@ -63,6 +64,16 @@ around '_query_start' => sub {
   $self->$method("DSN: $dsn SQL: $sql", @bind);
 };
 
+=head2 debugobj
+
+Override the debugobj method to redirect this method call back to the master.
+
+=cut
+
+sub debugobj {
+    return shift->schema->storage->debugobj;
+}
+
 =head1 AUTHOR
 
 John Napiorkowski <john.napiorkowski@takkle.com>