[Catalyst-commits] r14009 - in Catalyst-Model-DBIC-Schema/trunk: . lib/Catalyst/Helper/Model/DBIC lib/Catalyst/Model/DBIC lib/Catalyst/TraitFor/Model/DBIC/Schema

caelum at dev.catalyst.perl.org caelum at dev.catalyst.perl.org
Wed May 11 06:00:06 GMT 2011


Author: caelum
Date: 2011-05-11 06:00:06 +0000 (Wed, 11 May 2011)
New Revision: 14009

Modified:
   Catalyst-Model-DBIC-Schema/trunk/Changes
   Catalyst-Model-DBIC-Schema/trunk/lib/Catalyst/Helper/Model/DBIC/Schema.pm
   Catalyst-Model-DBIC-Schema/trunk/lib/Catalyst/Model/DBIC/Schema.pm
   Catalyst-Model-DBIC-Schema/trunk/lib/Catalyst/TraitFor/Model/DBIC/Schema/Replicated.pm
   Catalyst-Model-DBIC-Schema/trunk/lib/Catalyst/TraitFor/Model/DBIC/Schema/SchemaProxy.pm
Log:
fix ->isa check in Replicated trait, Model POD and SchemaProxy RS options

Modified: Catalyst-Model-DBIC-Schema/trunk/Changes
===================================================================
--- Catalyst-Model-DBIC-Schema/trunk/Changes	2011-05-11 04:59:45 UTC (rev 14008)
+++ Catalyst-Model-DBIC-Schema/trunk/Changes	2011-05-11 06:00:06 UTC (rev 14009)
@@ -1,6 +1,9 @@
 Revision history for Perl extension Catalyst::Model::DBIC::Schema
 
+        - make sure storage_type class is loaded before ->isa check in
+          Replicated trait (RT#65791)
         - fix regex stringification test for perl 5.14 (RT#68098)
+        - update connect_info POD (RT#66010)
 
 0.48  Thu Dec  9 21:08:33 UTC 2010
         - fix usage of Try::Tiny in helper

Modified: Catalyst-Model-DBIC-Schema/trunk/lib/Catalyst/Helper/Model/DBIC/Schema.pm
===================================================================
--- Catalyst-Model-DBIC-Schema/trunk/lib/Catalyst/Helper/Model/DBIC/Schema.pm	2011-05-11 04:59:45 UTC (rev 14008)
+++ Catalyst-Model-DBIC-Schema/trunk/lib/Catalyst/Helper/Model/DBIC/Schema.pm	2011-05-11 06:00:06 UTC (rev 14009)
@@ -88,12 +88,8 @@
   script/myapp_create.pl model CatalystModelName DBIC::Schema \
     MyApp::SchemaClass create=static dbi:SQLite:foo.db \
     AutoCommit=1 cursor_class=DBIx::Class::Cursor::Cached \
-    on_connect_do='["select 1", "select 2"]' quote_char='"'
+    on_connect_do='["select 1", "select 2"]' quote_names=1
 
-If using a 2 character quote_char:
-
-  script/myapp_create.pl ... quote_char='[]'
-
 B<ON WINDOWS COMMAND LINES QUOTING RULES ARE DIFFERENT>
 
 In C<cmd.exe> the above example would be:
@@ -101,7 +97,7 @@
   script/myapp_create.pl model CatalystModelName DBIC::Schema \
     MyApp::SchemaClass create=static dbi:SQLite:foo.db \
     AutoCommit=1 cursor_class=DBIx::Class::Cursor::Cached \
-    on_connect_do="[\"select 1\", \"select 2\"]" quote_char="\""
+    on_connect_do="[\"select 1\", \"select 2\"]" quote_names=1
 
 Same, but with extra Schema::Loader args (separate multiple values by commas):
 

Modified: Catalyst-Model-DBIC-Schema/trunk/lib/Catalyst/Model/DBIC/Schema.pm
===================================================================
--- Catalyst-Model-DBIC-Schema/trunk/lib/Catalyst/Model/DBIC/Schema.pm	2011-05-11 04:59:45 UTC (rev 14008)
+++ Catalyst-Model-DBIC-Schema/trunk/lib/Catalyst/Model/DBIC/Schema.pm	2011-05-11 06:00:06 UTC (rev 14009)
@@ -33,7 +33,7 @@
 
     script/myapp_create.pl model FilmDB DBIC::Schema MyApp::Schema::FilmDB \
         create=static dbi:mysql:filmdb dbusername dbpass \
-        quote_char='`' name_sep='.'
+        quote_names=1
 
 If you are unfamiliar with L<DBIx::Class>, see L<DBIx::Class::Manual::Intro>
 first.
@@ -169,13 +169,12 @@
 
 =head2 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). 
-If you only need one parameter (e.g. the DSN), you can just pass a string 
-instead of an arrayref.
+This is a hashref or arrayref of connection parameters, which are specific to
+your 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.
 
 This is not required if C<schema_class> already has connection information
-defined inside itself (which isn't highly recommended, but can be done)
+defined inside itself (which isn't highly recommended, but can be done.)
 
 For L<DBIx::Class::Storage::DBI>, which is the only supported
 C<storage_type> in L<DBIx::Class> at the time of this writing, the
@@ -220,7 +219,7 @@
             user   postgres
             password ""
             auto_savepoint 1
-	    quote_char """
+            quote_names 1
             on_connect_do   some SQL statement
             on_connect_do   another SQL statement
         </connect_info>
@@ -246,7 +245,7 @@
           LongReadLen: 1000000
           LongTruncOk: 1
           on_connect_call: 'datetime_setup'
-	  quote_char: '"'
+          quote_names: 1
 
 The old arrayref style with hashrefs for L<DBI> then L<DBIx::Class> options is also
 supported:

Modified: Catalyst-Model-DBIC-Schema/trunk/lib/Catalyst/TraitFor/Model/DBIC/Schema/Replicated.pm
===================================================================
--- Catalyst-Model-DBIC-Schema/trunk/lib/Catalyst/TraitFor/Model/DBIC/Schema/Replicated.pm	2011-05-11 04:59:45 UTC (rev 14008)
+++ Catalyst-Model-DBIC-Schema/trunk/lib/Catalyst/TraitFor/Model/DBIC/Schema/Replicated.pm	2011-05-11 06:00:06 UTC (rev 14009)
@@ -88,6 +88,8 @@
             "DBIx::Class::Storage$storage_type"
             : $storage_type;
 
+        Class::MOP::load_class($class);
+
         croak "This storage_type cannot be used with replication"
             unless $class->isa('DBIx::Class::Storage::DBI::Replicated');
     } else {

Modified: Catalyst-Model-DBIC-Schema/trunk/lib/Catalyst/TraitFor/Model/DBIC/Schema/SchemaProxy.pm
===================================================================
--- Catalyst-Model-DBIC-Schema/trunk/lib/Catalyst/TraitFor/Model/DBIC/Schema/SchemaProxy.pm	2011-05-11 04:59:45 UTC (rev 14008)
+++ Catalyst-Model-DBIC-Schema/trunk/lib/Catalyst/TraitFor/Model/DBIC/Schema/SchemaProxy.pm	2011-05-11 06:00:06 UTC (rev 14009)
@@ -165,19 +165,10 @@
 sub _pass_options_to_resultset {
     my ($self, $source, $args) = @_;
 
-    my @attributes = map {
-        $_->init_arg || ()
-    } $self->meta->get_all_attributes;
-
-    my %attributes;
-    @attributes{@attributes} = ();
-
     for my $opt (keys %$args) {
-        if (not exists $attributes{$opt}) {
-            my $rs_class = $self->schema->source($source)->resultset_class;
-            next unless $rs_class->can($opt);
-            $rs_class->$opt($args->{$opt});
-        }
+        my $rs_class = $self->schema->source($source)->resultset_class;
+        next unless $rs_class->can($opt);
+        $rs_class->$opt($args->{$opt});
     }
 }
 




More information about the Catalyst-commits mailing list