[Bast-commits] r6659 - in DBIx-Class/0.08/branches/on_connect_call: lib/DBIx/Class/Storage t

caelum at dev.catalyst.perl.org caelum at dev.catalyst.perl.org
Sat Jun 13 11:35:33 GMT 2009


Author: caelum
Date: 2009-06-13 11:35:33 +0000 (Sat, 13 Jun 2009)
New Revision: 6659

Modified:
   DBIx-Class/0.08/branches/on_connect_call/lib/DBIx/Class/Storage/DBI.pm
   DBIx-Class/0.08/branches/on_connect_call/t/92storage.t
Log:
make the on_(dis)?connect_do accessors returnn the original structure

Modified: DBIx-Class/0.08/branches/on_connect_call/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- DBIx-Class/0.08/branches/on_connect_call/lib/DBIx/Class/Storage/DBI.pm	2009-06-13 11:03:36 UTC (rev 6658)
+++ DBIx-Class/0.08/branches/on_connect_call/lib/DBIx/Class/Storage/DBI.pm	2009-06-13 11:35:33 UTC (rev 6659)
@@ -15,7 +15,7 @@
 __PACKAGE__->mk_group_accessors('simple' =>
     qw/_connect_info _dbi_connect_info _dbh _sql_maker _sql_maker_opts
        _conn_pid _conn_tid transaction_depth _dbh_autocommit _on_connect_do
-       _on_disconnect_do savepoints/
+       _on_disconnect_do __on_connect_do __on_disconnect_do savepoints/
 );
 
 # the values for these accessors are picked out (and deleted) from
@@ -472,6 +472,7 @@
   my ($self, $opt) = (shift, shift);
 
   my $accessor = "_$opt";
+  my $store    = "__$opt";
 
   return $self->$accessor if not @_;
 
@@ -492,7 +493,8 @@
     $self->throw_exception("Invalid type for $opt ".ref($val));
   }
 
-  $self->$accessor(\@store);
+  $self->$store(\@store);
+  $self->$accessor($val);
 }
 
 =head2 dbh_do
@@ -644,7 +646,7 @@
     if (my $connection_call = $self->on_disconnect_call) {
       $self->_do_connection_actions(disconnect_call_ => $connection_call)
     }
-    if (my $connection_do   = $self->_on_disconnect_do) {
+    if (my $connection_do   = $self->__on_disconnect_do) {
       $self->_do_connection_actions(disconnect_call_ => $connection_do)
     }
 
@@ -766,7 +768,7 @@
   if (my $connection_call = $self->on_connect_call) {
     $self->_do_connection_actions(connect_call_ => $connection_call)
   }
-  if (my $connection_do = $self->_on_connect_do) {
+  if (my $connection_do = $self->__on_connect_do) {
     $self->_do_connection_actions(connect_call_ => $connection_do)
   }
 }

Modified: DBIx-Class/0.08/branches/on_connect_call/t/92storage.t
===================================================================
--- DBIx-Class/0.08/branches/on_connect_call/t/92storage.t	2009-06-13 11:03:36 UTC (rev 6658)
+++ DBIx-Class/0.08/branches/on_connect_call/t/92storage.t	2009-06-13 11:35:33 UTC (rev 6659)
@@ -162,7 +162,7 @@
 
   is_deeply (
     [$storage->on_connect_do, $storage->on_disconnect_do ],
-    [ [ map [ do_sql => $_ ], qw/a b c/ ], [ map [ do_sql => $_ ], qw/d e f/ ] ],
+    [ [qw/a b c/], [qw/d e f/] ],
     "$type correctly parsed DBIC specific on_[dis]connect_do",
   );
 }




More information about the Bast-commits mailing list