skip structs in loader args after connect_info v0.52
Rafael Kitover [Thu, 28 Jul 2011 22:28:27 +0000 (18:28 -0400)]
Skips structs when reading extra loader args after the connect_info in
the helper.

Also a new release, 0.52.

Changes
lib/Catalyst/Helper/Model/DBIC/Schema.pm
lib/Catalyst/Model/DBIC/Schema.pm

diff --git a/Changes b/Changes
index e0c31d3..64aed1d 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 Revision history for Perl extension Catalyst::Model::DBIC::Schema
 
+0.52  Thu Jul 28 22:07:38 UTC 2011
+        - fix a bug in loader args reading after connect_info (skip structs)
+
 0.51  Wed Jul 27 20:57:47 UTC 2011
         - warn when helper finds no tables
         - accept loader args after connect_info
index 5062ec1..472ef90 100644 (file)
@@ -4,7 +4,7 @@ use namespace::autoclean;
 use Moose;
 no warnings 'uninitialized';
 
-our $VERSION = '0.51';
+our $VERSION = '0.52';
 $VERSION = eval $VERSION;
 
 use Carp;
@@ -312,6 +312,10 @@ sub _read_loader_args {
     }
 
     while (defined $args->[$i]) {
+        $i++ while $self->_is_struct($args->[$i]);
+
+        last if not defined $args->[$i];
+
         my ($key, $val) = split /=/, $args->[$i++], 2;
 
         if ($self->_is_struct($val)) {
index 12a3185..526d938 100644 (file)
@@ -5,7 +5,7 @@ use mro 'c3';
 extends 'Catalyst::Model';
 with 'CatalystX::Component::Traits';
 
-our $VERSION = '0.51';
+our $VERSION = '0.52';
 $VERSION = eval $VERSION;
 
 use namespace::autoclean;