[Catalyst-commits] r10170 - in trunk/Catalyst-Model-DBIC-Schema/lib/Catalyst: Helper/Model/DBIC Model/DBIC Model/DBIC/Schema

caelum at dev.catalyst.perl.org caelum at dev.catalyst.perl.org
Fri May 15 15:47:33 GMT 2009


Author: caelum
Date: 2009-05-15 15:47:33 +0000 (Fri, 15 May 2009)
New Revision: 10170

Modified:
   trunk/Catalyst-Model-DBIC-Schema/lib/Catalyst/Helper/Model/DBIC/Schema.pm
   trunk/Catalyst-Model-DBIC-Schema/lib/Catalyst/Model/DBIC/Schema.pm
   trunk/Catalyst-Model-DBIC-Schema/lib/Catalyst/Model/DBIC/Schema/Types.pm
Log:
fix dbic helper fuckage

Modified: trunk/Catalyst-Model-DBIC-Schema/lib/Catalyst/Helper/Model/DBIC/Schema.pm
===================================================================
--- trunk/Catalyst-Model-DBIC-Schema/lib/Catalyst/Helper/Model/DBIC/Schema.pm	2009-05-15 12:53:54 UTC (rev 10169)
+++ trunk/Catalyst-Model-DBIC-Schema/lib/Catalyst/Helper/Model/DBIC/Schema.pm	2009-05-15 15:47:33 UTC (rev 10170)
@@ -348,7 +348,12 @@
 
         my ($key, $val) = split /=/, $_, 2;
 
-        $connect_info{$key} = eval $val;
+        if ($key =~ /^(?:quote_char|name_sep)\z/) {
+            $connect_info{$key} = $val;
+        } else {
+            $connect_info{$key} = eval $val;
+        }
+
         die "syntax error for connect_info key '$key' with value '$val': $@"
             if $@;
     }
@@ -430,7 +435,9 @@
     my ($self, $args) = @_;
 
 # remove blanks, ie. someoned doing foo \  bar
-    my @res = grep !/^\s*\z/, @$args;
+#    my @res = grep !/^\s*\z/, @$args;
+# bad idea.
+    my @res = @$args;
 
 # remove leading whitespace, ie. foo \ bar
     s/^\s*// for @res;

Modified: trunk/Catalyst-Model-DBIC-Schema/lib/Catalyst/Model/DBIC/Schema/Types.pm
===================================================================
--- trunk/Catalyst-Model-DBIC-Schema/lib/Catalyst/Model/DBIC/Schema/Types.pm	2009-05-15 12:53:54 UTC (rev 10169)
+++ trunk/Catalyst-Model-DBIC-Schema/lib/Catalyst/Model/DBIC/Schema/Types.pm	2009-05-15 15:47:33 UTC (rev 10170)
@@ -1,7 +1,7 @@
 package Catalyst::Model::DBIC::Schema::Types;
 
 use MooseX::Types
-    -declare => [qw/ConnectInfo ConnectInfos Replicants SchemaClass/];
+ -declare => [qw/ConnectInfo ConnectInfos Replicants SchemaClass CursorClass/];
 
 use Carp::Clan '^Catalyst::Model::DBIC::Schema';
 use MooseX::Types::Moose qw/ArrayRef HashRef Str ClassName/;
@@ -17,6 +17,13 @@
     from Str,
     via { Class::MOP::load_class($_); $_ };
 
+subtype CursorClass,
+    as ClassName;
+
+coerce CursorClass,
+    from Str,
+    via { Class::MOP::load_class($_); $_ };
+
 subtype ConnectInfo,
     as HashRef,
     where { exists $_->{dsn} },

Modified: trunk/Catalyst-Model-DBIC-Schema/lib/Catalyst/Model/DBIC/Schema.pm
===================================================================
--- trunk/Catalyst-Model-DBIC-Schema/lib/Catalyst/Model/DBIC/Schema.pm	2009-05-15 12:53:54 UTC (rev 10169)
+++ trunk/Catalyst-Model-DBIC-Schema/lib/Catalyst/Model/DBIC/Schema.pm	2009-05-15 15:47:33 UTC (rev 10170)
@@ -15,6 +15,7 @@
 use Moose::Autobox;
 
 use Catalyst::Model::DBIC::Schema::Types qw/ConnectInfo SchemaClass/;
+use MooseX::Types::Moose qw/ArrayRef Str ClassName/;
 
 use namespace::clean -except => 'meta';
 
@@ -387,17 +388,17 @@
     required => 1
 );
 
-has 'storage_type' => (is => 'rw', isa => 'Str');
+has 'storage_type' => (is => 'rw', isa => Str);
 
 has 'connect_info' => (is => 'ro', isa => ConnectInfo, coerce => 1);
 
 # ref $self changes to anon after roles are applied, and _original_class_name is
 # broken in MX::O::P 0.0009
-has '_class_name' => (is => 'ro', isa => 'ClassName', default => sub {
+has '_class_name' => (is => 'ro', isa => ClassName, default => sub {
     ref shift
 });
 
-has 'model_name' => (is => 'ro', isa => 'Str', default => sub {
+has 'model_name' => (is => 'ro', isa => Str, default => sub {
     my $self = shift;
 
     my $class = ref $self;
@@ -406,7 +407,7 @@
     $model_name
 });
 
-has 'roles' => (is => 'ro', isa => 'ArrayRef|Str');
+has 'roles' => (is => 'ro', isa => ArrayRef|Str);
 
 sub BUILD {
     my $self = shift;




More information about the Catalyst-commits mailing list