Revision history for Perl extension Catalyst::Model::DBIC::Schema
+0.51 Wed Jul 27 20:57:47 UTC 2011
- warn when helper finds no tables
+ - accept loader args after connect_info
0.50 Fri May 20 22:45:07 UTC 2011
- change repository link to the new git repo
use Moose;
no warnings 'uninitialized';
-our $VERSION = '0.50';
+our $VERSION = '0.51';
$VERSION = eval $VERSION;
use Carp;
}
}
+ # Use args after connect_info as loader args as well, because people always
+ # get the order confused.
+ my $i = 1;
+ if ($args->[0] =~ /sqlite/i) {
+ $i++ if $args->[$i] eq '';
+ $i++ if $args->[$i] eq '';
+ }
+ else {
+ $i += 2;
+ }
+
+ while (defined $args->[$i]) {
+ my ($key, $val) = split /=/, $args->[$i++], 2;
+
+ if ($self->_is_struct($val)) {
+ $loader_args{$key} = $val;
+ } elsif ((my @vals = split /,/ => $val) > 1) {
+ $loader_args{$key} = \@vals;
+ } else {
+ $loader_args{$key} = $val;
+ }
+ }
+
wantarray ? %loader_args : \%loader_args;
}
extends 'Catalyst::Model';
with 'CatalystX::Component::Traits';
-our $VERSION = '0.50';
+our $VERSION = '0.51';
$VERSION = eval $VERSION;
use namespace::autoclean;
is $i->helper->{connect_info}{AutoCommit}, 'q{0}',
'connect_info arg from extra hash as string';
+$i = instance(args => [
+ $static, 'components=TimeStamp', $sqlite, $on_connect_do,
+ $quote_char, $name_sep, 'auto_savepoint=1', 'AutoCommit=0',
+ 'db_schema=myschema',
+]);
+
+is $i->loader_args->{db_schema}, 'myschema',
+ 'loader arg after connect_info';
+
done_testing;
sub instance {