[Catalyst-commits] r8252 - trunk/Catalyst-Model-DBIC-Schema/lib/Catalyst/Model/DBIC

zamolxes at dev.catalyst.perl.org zamolxes at dev.catalyst.perl.org
Fri Aug 22 00:19:16 BST 2008


Author: zamolxes
Date: 2008-08-22 00:19:16 +0100 (Fri, 22 Aug 2008)
New Revision: 8252

Modified:
   trunk/Catalyst-Model-DBIC-Schema/lib/Catalyst/Model/DBIC/Schema.pm
Log:
connect_info can be a string if you only need to pass the DSN


Modified: trunk/Catalyst-Model-DBIC-Schema/lib/Catalyst/Model/DBIC/Schema.pm
===================================================================
--- trunk/Catalyst-Model-DBIC-Schema/lib/Catalyst/Model/DBIC/Schema.pm	2008-08-21 22:28:26 UTC (rev 8251)
+++ trunk/Catalyst-Model-DBIC-Schema/lib/Catalyst/Model/DBIC/Schema.pm	2008-08-21 23:19:16 UTC (rev 8252)
@@ -156,7 +156,9 @@
 =item connect_info
 
 This is an arrayref of connection parameters, which are specific to your
-C<storage_type> (see your storage type documentation for more details).
+C<storage_type> (see your storage type documentation for more details). 
+If you only need one parameter (e.g. the DSN), you can just pass a string 
+instead of an arrayref.
 
 This is not required if C<schema_class> already has connection information
 defined inside itself (which isn't highly recommended, but can be done)
@@ -289,7 +291,11 @@
     $self->schema->storage_type($self->{storage_type})
         if $self->{storage_type};
 
-    $self->schema->connection(@{$self->{connect_info}});
+    $self->schema->connection( 
+        ref $self->{connect_info} eq 'ARRAY' ? 
+        @{$self->{connect_info}} : 
+        $self->{connect_info}
+    );
     
     no strict 'refs';
     foreach my $moniker ($self->schema->sources) {




More information about the Catalyst-commits mailing list