[Bast-commits] r5938 - DBIx-Class/0.08/allow-false-connection-attrs/lib/DBIx/Class/Storage

solomon at dev.catalyst.perl.org solomon at dev.catalyst.perl.org
Tue Apr 21 20:09:25 GMT 2009


Author: solomon
Date: 2009-04-21 21:09:24 +0100 (Tue, 21 Apr 2009)
New Revision: 5938

Modified:
   DBIx-Class/0.08/allow-false-connection-attrs/lib/DBIx/Class/Storage/DBI.pm
Log:
Allow setting connection attributes to 0, undef, and ''

Modified: DBIx-Class/0.08/allow-false-connection-attrs/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- DBIx-Class/0.08/allow-false-connection-attrs/lib/DBIx/Class/Storage/DBI.pm	2009-04-21 20:07:49 UTC (rev 5937)
+++ DBIx-Class/0.08/allow-false-connection-attrs/lib/DBIx/Class/Storage/DBI.pm	2009-04-21 20:09:24 UTC (rev 5938)
@@ -651,16 +651,10 @@
   $self->_sql_maker_opts({});
 
   if(keys %attrs) {
-    for my $storage_opt (@storage_options, 'cursor_class') {    # @storage_options is declared at the top of the module
-      if(my $value = delete $attrs{$storage_opt}) {
-        $self->$storage_opt($value);
-      }
-    }
-    for my $sql_maker_opt (qw/limit_dialect quote_char name_sep/) {
-      if(my $opt_val = delete $attrs{$sql_maker_opt}) {
-        $self->_sql_maker_opts->{$sql_maker_opt} = $opt_val;
-      }
-    }
+    $self->$_(delete $attrs{$_})
+      for grep {exists $attrs{$_}} (@storage_options, 'cursor_class');   # @storage_options is declared at the top of the module
+    $self->_sql_maker_opts->{$_} = delete $attrs{$_}
+      for grep {exists $attrs{$_}} qw/limit_dialect quote_char name_sep/;
   }
 
   %attrs = () if (ref $args[0] eq 'CODE');  # _connect() never looks past $args[0] in this case




More information about the Bast-commits mailing list