X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FHelper%2FModel%2FDBIC%2FSchema.pm;h=03f9741104d36a6c6ef0031a1d24969403025b86;hb=4e251d1a0b63c080957709a10a6ec6a5b6a94769;hp=026e6f4a335e585eb567677508dbd0049a5a9029;hpb=078c5263726fc9c8b798b79f5cb8e54e860b7d36;p=catagits%2FCatalyst-Model-DBIC-Schema.git diff --git a/lib/Catalyst/Helper/Model/DBIC/Schema.pm b/lib/Catalyst/Helper/Model/DBIC/Schema.pm index 026e6f4..03f9741 100644 --- a/lib/Catalyst/Helper/Model/DBIC/Schema.pm +++ b/lib/Catalyst/Helper/Model/DBIC/Schema.pm @@ -4,7 +4,8 @@ use namespace::autoclean; use Moose; no warnings 'uninitialized'; -our $VERSION = '0.26'; +our $VERSION = '0.31'; +$VERSION = eval $VERSION; use Carp; use Tie::IxHash (); @@ -12,7 +13,6 @@ use Data::Dumper (); use List::Util 'first'; use MooseX::Types::Moose qw/Str HashRef Bool ArrayRef/; use Catalyst::Model::DBIC::Schema::Types 'CreateOption'; -use Moose::Autobox; use List::MoreUtils 'firstidx'; use Scalar::Util 'looks_like_number'; @@ -161,7 +161,7 @@ sub mk_compclass { sub BUILD { my $self = shift; my $helper = $self->helper; - my @args = $self->args->flatten if $self->args; + my @args = @{ $self->args || [] }; $helper->{schema_class} = $self->schema_class; @@ -174,7 +174,7 @@ sub BUILD { $self->traits(\@traits); $helper->{traits} = '[' - .(join ',' => map { qq{'$_'} } ($self->traits->flatten)) + .(join ',' => map { qq{'$_'} } @traits) .']'; splice @args, $traits_idx, 1, (); @@ -188,21 +188,21 @@ sub BUILD { $self->_parse_loader_args(\@args); $helper->{loader_args} = $self->_build_helper_loader_args; + } + } - my $dbi_dsn_part; - if (first { ($dbi_dsn_part) = /^(dbi):/i } @args) { - die + my $dbi_dsn_part; + if (first { ($dbi_dsn_part) = /^(dbi):/i } @args) { + die qq{DSN must start with 'dbi:' not '$dbi_dsn_part' (case matters!)} - if $dbi_dsn_part ne 'dbi'; + if $dbi_dsn_part ne 'dbi'; - $helper->{setup_connect_info} = 1; + $helper->{setup_connect_info} = 1; - $helper->{connect_info} = - $self->_build_helper_connect_info(\@args); + $helper->{connect_info} = + $self->_build_helper_connect_info(\@args); - $self->_parse_connect_info(\@args); - } - } + $self->_parse_connect_info(\@args); } $helper->{generator} = ref $self; @@ -568,11 +568,12 @@ L, L =head1 AUTHOR -Brandon L Black, C +See L and +L. -Contributors: +=head1 COPYRIGHT -Rafael Kitover, C +See L. =head1 LICENSE