=head1 SYNOPSIS
script/create.pl model CatalystModelName DBIC::Schema MyApp::SchemaClass \
- [ create=dynamic | create=static ] [ Schema::Loader opts ] \
- [ dsn user pass ] [ other connect_info arguments ]
+ [ create=dynamic | create=static ] [ roles=role1,role2... ] \
+ [ Schema::Loader opts ] [ dsn user pass ] \
+ [ other connect_info args ]
=head1 DESCRIPTION
adapt itself to changes in your database structure. You can edit
the generated classes by hand to refine them.
+C<roles> is the list of roles to apply to the model, see
+L<Catalyst::Model::DBIC::Schema> for details.
+
+C<Schema::Loader opts> are described in L</TYPICAL EXAMPLES> below.
+
C<connect_info> arguments are the same as what
DBIx::Class::Schema::connect expects, and are storage_type-specific.
For DBI-based storage, these arguments are the dsn, username,
$self->helper($helper);
my $create = '';
- if ($args[0] && $args[0] =~ /^create=(dynamic|static)$/) {
+ if ($args[0] && $args[0] =~ /^create=(dynamic|static)\z/) {
$create = $1;
shift @args;
+ if ($args[0] && $args[0] =~ /^roles=(.*)\z/) {
+ $helper->{roles} = '['
+ .(join ',' => map { qq{'$_'} } (split /,/ => $1))
+ .']';
+ shift @args;
+ }
+
if (@args) {
$self->_parse_loader_args(\@args);
Brandon L Black, C<blblack@gmail.com>
+Contributors:
+
+Rafael Kitover, C<<rkitover at cpan.org>>
+
=head1 LICENSE
This library is free software, you can redistribute it and/or modify
__PACKAGE__->config(
schema_class => '[% schema_class %]',
+ [% IF roles %]roles => [% roles %],[% END %]
[% IF setup_connect_info %]connect_info => {
[%- FOREACH key = connect_info.keys %]
[% key %] => [% connect_info.${key} %],