Permalink
Browse files

Tagging release 0.08

  • Loading branch information...
1 parent 2d901c7 commit 147f40dfb7593dae598d1cd1c5c1e828b909ada3 @amiri committed Nov 4, 2011
View
53 Changes
@@ -0,0 +1,53 @@
+Revison history for {{$dist->name}}
+
+{{$NEXT}}
+
+ - a bugfix, cleanups, and enhancements (RsrchBoy)
+ https://github.com/amiri/Catalyst-Helper-Controller-DBIC-API-REST-0.01/pull/1
+
+ - model name can now be something other than "DB" (RsrchBoy)
+
+ - app name can now be more than one level deep (e.g. My::App now works rather
+ than abending) (RsrchBoy)
+
+ - No more Module::Load, require namespace::autoclean (RsrchBoy)
+
+ - use Dist::Zilla (amiri)
+
+ - Clean and rearrange test lib and tests (amiri)
+
+0.07 Sat Oct 24 10:40:53 2009
+
+ - Remove swaps (amiri)
+
+0.06 Sat Oct 24 10:37:56 2009
+
+ - Hide test modules from PAUSE. (amiri)
+
+0.05 Sat Oct 24 10:08:07 2009
+
+ - Add prereqs to fix make failures. Use parent instead of base. (amiri)
+
+
+0.04 Thu Aug 20 12:45:08 2009
+
+ - some code cleanup (franck cuny)
+
+ - Autogenerate README (amiri)
+
+
+0.03 Sat Jul 4 12:55:05 2009
+
+0.02 Fri Jun 26 11:02:10 2009
+
+ - Removed Test::Deep from tests. Full documentation. (amiri)
+
+ - Conditional insertion of list_prefetch and list_prefetch_allows;
+ comprehensive list_search_exposes.
+
+ - Much smarter prefetch. ControllerBase creation and subclassing.
+
+
+0.01 Sun Jun 14 11:50:52 2009
+
+ - original version
View
147 README
@@ -0,0 +1,147 @@
+NAME
+ Catalyst::Helper::Controller::DBIC::API::REST
+
+SYNOPSIS
+ $ catalyst.pl MyApp
+ $ cd MyApp
+ $ script/myapp_create.pl controller API::REST DBIC::API::REST \
+ MyApp::Schema MyApp::Model::DB
+
+
+ ...
+
+ package MyApp::Controller::API::REST::Producer;
+
+ use strict;
+ use warnings;
+ use base qw/MyApp::ControllerBase::REST/;
+ use JSON::XS;
+
+ __PACKAGE__->config(
+ action => { setup => {
+ PathPart => 'producer',
+ Chained => '/api/rest/rest_base' }
+ }, # define parent chain action and partpath
+ class => 'DB::Producer', # DBIC result class
+ create_requires => [qw/name/], # columns required
+ # to create
+ create_allows => [qw//], # additional non-required
+ # columns that
+ # create allows
+ update_allows => [qw/name/], # columns that
+ # update allows
+ list_returns => [qw/producerid name/], # columns that
+ # list returns
+
+ list_prefetch_allows => [ # every possible prefetch param allowed
+ [qw/cd_to_producer/], { 'cd_to_producer' => [qw//] },
+ [qw/tags/], { 'tags' => [qw//] },
+ [qw/tracks/], { 'tracks' => [qw//] },
+ ],
+
+ list_ordered_by => [ qw/producerid/ ],
+ # order of generated list
+ list_search_exposes => [ qw/producerid name/ ],
+ # columns that can be searched on via list
+ );
+
+DESCRIPTION
+ This creates REST controllers according to the specifications at
+ L<Catalyst::Controller::DBIC::API> and L<Catalyst::Controller::DBIC::API::REST>
+ for all the classes in your Catalyst app.
+
+ It creates the following files:
+
+ MyApp/lib/MyApp/Controller/API.pm
+ MyApp/lib/MyApp/Controller/API/REST.pm
+ MyApp/lib/MyApp/Controller/API/REST/*
+ MyApp/lib/MyApp/ControllerBase/REST.pm
+
+ Individual class controllers are under MyApp/lib/MyApp/Controller/API/REST/*.
+
+ CONFIGURATION
+ The idea is to make configuration as painless and as automatic as possible, so most
+ of the work has been done for you.
+
+ There are 8 __PACKAGE__->config(...) options for L<Catalyst::Controller::DBIC::API/CONFIGURATION>.
+ Here are the defaults.
+
+ create_requires
+ All non-nullable columns that are (1) not autoincrementing,
+ (2) don't have a default value, are neither (3) nextvals,
+ (4) sequences, nor (5) timestamps.
+
+ create_allows
+ All nullable columns that are (1) not autoincrementing,
+ (2) don't have a default value, are neither (3) nextvals,
+ (4) sequences, nor (5) timestamps.
+
+ update_allows
+ The union of create_requires and create_allows.
+
+ list_returns
+ Every column in the class.
+
+ list_prefetch
+ Nothing is prefetched by default.
+
+ list_prefetch_allows
+ (1) An arrayref consisting of the name of each of the class's
+ has_many relationships, accompanied by (2) a hashref keyed on
+ the name of that relationship, whose values are the names of
+ its has_many's, e.g., in the "Producer" controller above, a
+ Producer has many cd_to_producers, many tags, and many tracks.
+ None of those classes have any has_many's:
+
+ list_prefetch_allows => [
+ [qw/cd_to_producer/], { 'cd_to_producer' => [qw//] },
+ [qw/tags/], { 'tags' => [qw//] },
+ [qw/tracks/], { 'tracks' => [qw//] },
+ ],
+
+ list_ordered_by
+ The primary key.
+
+ list_search_exposes
+ (1) An arrayref consisting of the name of each column in the class,
+ and (2) a hashref keyed on the name of each of the class's has many
+ relationships, the values of which are all the columns in the
+ corresponding class, e.g.,
+
+ list_search_exposes => [
+ qw/cdid artist title year/,
+ { 'cd_to_producer' => [qw/cd producer/] },
+ { 'tags' => [qw/tagid cd tag/] },
+ { 'tracks' => [qw/trackid cd position title last_updated_on/] },
+ ], # columns that can be searched on via list
+
+CONTROLLERBASE
+ Following the advice in L<Catalyst::Controller::DBIC::API/EXTENDING>, this
+ module creates an intermediate class between your controllers and
+ L<Catalyst::Controller::DBIC::API::REST>. It contains one method, create,
+ which serializes object information and stores it in the stash, which is
+ not the default behavior.
+
+METHODS
+ mk_compclass
+ This is the meat of the helper. It writes the directory structure if it is
+ not in place, API.pm, REST.pm, the controllerbase, and the result class
+ controllers. It replaces $helper->{} values as it goes through, rendering
+ the files for each.
+
+AUTHOR
+ Amiri Barksdale <amiri@arisdottle.net>
+
+CONTRIBUTORS
+ Franck Cuny (lumberjaph) <franck@lumberjaph.net>
+
+ Chris Weyl (RsrchBoy) <cweyl@alumni.drew.edu>
+
+SEE ALSO
+ Catalyst::Controller::DBIC::API Catalyst::Controller::DBIC::API::REST
+ Catalyst::Controller::DBIC::API::RPC
+
+LICENSE
+ This library is free software; you can redistribute it and/or modify it
+ under the same terms as Perl itself.
+
View
5 dist.ini
@@ -22,8 +22,9 @@ repo = Catalyst-Helper-Controller-DBIC-API-REST-0.01
[AutoPrereqs]
[OurPkgVersion]
-[@TestingMania]
+
[NextRelease]
format = %-9v %{yyyy-MM-dd}d
-[ChangelogFromGit]
+[@TestingMania]
+ disable = NoTabsTests,EOLTests,Test::Synopsis
View
149 lib/Catalyst/Helper/Controller/DBIC/API/REST.pm
@@ -11,6 +11,7 @@ use File::Spec;
use lib "$FindBin::Bin/../lib";
BEGIN {
+
# VERSION
}
@@ -25,6 +26,7 @@ Catalyst::Helper::Controller::DBIC::API::REST
$ script/myapp_create.pl controller API::REST DBIC::API::REST \
MyApp::Schema MyApp::Model::DB
+
...
package MyApp::Controller::API::REST::Producer;
@@ -69,7 +71,7 @@ Catalyst::Helper::Controller::DBIC::API::REST
for all the classes in your Catalyst app.
It creates the following files:
-
+
MyApp/lib/MyApp/Controller/API.pm
MyApp/lib/MyApp/Controller/API/REST.pm
MyApp/lib/MyApp/Controller/API/REST/*
@@ -81,15 +83,15 @@ Catalyst::Helper::Controller::DBIC::API::REST
The idea is to make configuration as painless and as automatic as possible, so most
of the work has been done for you.
-
+
There are 8 __PACKAGE__->config(...) options for L<Catalyst::Controller::DBIC::API/CONFIGURATION>.
Here are the defaults.
-
+
=head2 create_requires
All non-nullable columns that are (1) not autoincrementing,
(2) don't have a default value, are neither (3) nextvals,
- (4) sequences, nor (5) timestamps.
+ (4) sequences, nor (5) timestamps.
=head2 create_allows
@@ -99,7 +101,7 @@ Catalyst::Helper::Controller::DBIC::API::REST
=head2 update_allows
- The union of create_requires and create_allows.
+ The union of create_requires and create_allows.
=head2 list_returns
@@ -129,11 +131,11 @@ Catalyst::Helper::Controller::DBIC::API::REST
The primary key.
=head2 list_search_exposes
-
+
(1) An arrayref consisting of the name of each column in the class,
and (2) a hashref keyed on the name of each of the class's has many
relationships, the values of which are all the columns in the
- corresponding class, e.g.,
+ corresponding class, e.g.,
list_search_exposes => [
qw/cdid artist title year/,
@@ -169,9 +171,9 @@ Amiri Barksdale E<lt>amiri@arisdottle.netE<gt>
=head1 CONTRIBUTORS
-Matt S. Trout (mst) E<lt>mst@shadowcat.co.ukE<gt>
+Franck Cuny (lumberjaph) <franck@lumberjaph.net>
-Tomas Doran (t0m) E<lt>bobtfish@bobtfish.netE<gt>
+Chris Weyl (RsrchBoy) <cweyl@alumni.drew.edu>
=head1 SEE ALSO
@@ -192,24 +194,21 @@ sub mk_compclass {
$schema_class ||= $helper->{app} . '::Schema';
$model ||= $helper->{app} . '::Model::DB';
- (my $model_base = $model) =~ s/^.*::Model:://;
+ ( my $model_base = $model ) =~ s/^.*::Model:://;
$helper->{script} = File::Spec->catdir( $helper->{dir}, 'script' );
$helper->{appprefix} = Catalyst::Utils::appprefix( $helper->{name} );
## Connect to schema for class info
Class::MOP::load_class($schema_class);
- my $schema = $schema_class->connect;
-
- ## Lookup table for source lookups in list_prefetch_allows
- my %name_to_source =
- map { $schema->source($_)->name => $_ } $schema->sources;
+ my $schema = $schema_class->connect;
- my $path_app =
- File::Spec->catdir( $FindBin::Bin, "..", "lib", split(/::/, $helper->{app}) );
+ my $path_app = File::Spec->catdir( $FindBin::Bin, "..", "lib",
+ split( /::/, $helper->{app} ) );
## Make api base
- my $api_file = File::Spec->catfile( $path_app, $helper->{type}, "API.pm" );
+ my $api_file
+ = File::Spec->catfile( $path_app, $helper->{type}, "API.pm" );
( my $api_path = $api_file ) =~ s/\.pm$//;
$helper->mk_dir($api_path);
@@ -218,8 +217,8 @@ sub mk_compclass {
$helper->_mk_comptest;
## Make rest base
- my $rest_file =
- File::Spec->catfile( $path_app, $helper->{type}, "API", "REST.pm" );
+ my $rest_file
+ = File::Spec->catfile( $path_app, $helper->{type}, "API", "REST.pm" );
( my $rest_path = $rest_file ) =~ s/\.pm$//;
$helper->mk_dir($rest_path);
@@ -228,8 +227,8 @@ sub mk_compclass {
$helper->_mk_comptest;
## Make controller base
- my $base_file =
- File::Spec->catfile( $path_app, "ControllerBase", "REST.pm" );
+ my $base_file
+ = File::Spec->catfile( $path_app, "ControllerBase", "REST.pm" );
$helper->mk_dir( File::Spec->catdir( $path_app, "ControllerBase" ) );
$helper->render_file( 'controllerbase', $base_file );
@@ -239,11 +238,15 @@ sub mk_compclass {
## Make result class controllers
for my $source ( $schema->sources ) {
my ( $class, $result_class );
- my $file =
- File::Spec->catfile( $path_app, $helper->{type}, "API", "REST",
+ my $file
+ = File::Spec->catfile( $path_app, $helper->{type}, "API", "REST",
$source . ".pm" );
- $class =
- $helper->{app} . "::" . $helper->{type} . "::API::REST::" . $source;
+ $class
+ = $helper->{app} . "::"
+ . $helper->{type}
+ . "::API::REST::"
+ . $source;
+
#$result_class = $helper->{app} . "::Model::DB::" . $source;
$result_class = $model_base . '::' . $source;
@@ -252,77 +255,78 @@ sub mk_compclass {
my @create_allows;
my @update_allows;
my @list_prefetch;
- my @list_search_exposes = my @list_returns =
- $schema->source($source)->columns;
+ my @list_search_exposes = my @list_returns
+ = $schema->source($source)->columns;
### HAIRY RELATIONSHIPS STUFF
- my @sub_list_search_exposes = my @list_prefetch_allows =
- _return_has_many_list( $schema->source($source)->_relationships );
+ my @sub_list_search_exposes = my @list_prefetch_allows
+ = _return_has_many_list(
+ $schema->source($source)->_relationships );
@list_prefetch_allows = map {
my $ref = $_;
- qq|[qw/$ref->[0]/], { |
- . qq| '$ref->[0]' => [qw/|
- . join(
+ qq|[qw/$ref->[0]/], { |
+ . qq| '$ref->[0]' => [qw/|
+ . join(
' ',
map { $_->[0] } _return_has_many_list(
$schema->source( $ref->[1] )->_relationships
)
- ) . qq|/] },\n\t\t|;
+ ) . qq|/] },\n\t\t|;
} @list_prefetch_allows;
@sub_list_search_exposes = map {
my $ref = $_;
qq|{ '$ref->[0]' => [qw/|
- . join( ' ', $schema->source( $ref->[1] )->columns )
- . qq|/] },\n\t\t|;
+ . join( ' ', $schema->source( $ref->[1] )->columns )
+ . qq|/] },\n\t\t|;
} @sub_list_search_exposes;
### END HAIRY RELATIONSHIP STUFF
my @list_ordered_by = $schema->source($source)->primary_columns;
### Prepare hash of column info for this class, so we can extract config
- my %source_col_info =
- map { $_, $schema->source($source)->column_info($_) }
- $schema->source($source)->columns;
+ my %source_col_info
+ = map { $_, $schema->source($source)->column_info($_) }
+ $schema->source($source)->columns;
for my $k ( sort keys %source_col_info ) {
no warnings qw/uninitialized/;
- if (
- ( !$source_col_info{$k}->{'is_auto_increment'} )
+ if (( !$source_col_info{$k}->{'is_auto_increment'} )
&& !(
- $source_col_info{$k}->{'default_value'} =~
- /(nextval|sequence|timestamp)/
+ $source_col_info{$k}->{'default_value'}
+ =~ /(nextval|sequence|timestamp)/
+ )
)
- )
{
### Extract create required
push @create_requires, $k
- if !$source_col_info{$k}->{'is_nullable'};
+ if !$source_col_info{$k}->{'is_nullable'};
### Extract create_allowed
push @create_allows, $k
- if $source_col_info{$k}->{'is_nullable'};
+ if $source_col_info{$k}->{'is_nullable'};
}
else { }
@update_allows = ( @create_requires, @create_allows );
}
$helper->{class} = $class;
$helper->{result_class} = $model_base . '::' . $source;
- $helper->{class_name} = $schema->source_registrations->{$source}->name;
- $helper->{file} = $file;
+ $helper->{class_name}
+ = $schema->source_registrations->{$source}->name;
+ $helper->{file} = $file;
$helper->{create_requires} = join( ' ', @create_requires );
$helper->{create_allows} = join( ' ', @create_allows );
$helper->{list_returns} = join( ' ', @list_returns );
$helper->{list_search_exposes} = join( ' ', @list_search_exposes );
- $helper->{sub_list_search_exposes} =
- join( '', @sub_list_search_exposes );
+ $helper->{sub_list_search_exposes}
+ = join( '', @sub_list_search_exposes );
$helper->{update_allows} = join( ' ', @update_allows );
$helper->{list_prefetch_allows} = join( '', @list_prefetch_allows )
- if scalar @list_prefetch_allows > 0;
- $helper->{list_prefetch} =
- join( ', ', map { qq|'$_->[0]'| } @list_prefetch )
- if scalar @list_prefetch > 0;
+ if scalar @list_prefetch_allows > 0;
+ $helper->{list_prefetch}
+ = join( ', ', map {qq|'$_->[0]'|} @list_prefetch )
+ if scalar @list_prefetch > 0;
$helper->{list_ordered_by} = join( ' ', @list_ordered_by );
$helper->render_file( 'compclass', $file );
$helper->{test} = $helper->next_test($source);
@@ -333,8 +337,9 @@ sub mk_compclass {
sub _return_has_many_list {
my ($relationships) = @_;
return
- grep { $relationships->{ $_->[0] }->{attrs}->{accessor} =~ /multi/ }
- map { [ $_, $relationships->{$_}->{source} ] } sort keys %$relationships;
+ grep { $relationships->{ $_->[0] }->{attrs}->{accessor} =~ /multi/ }
+ map { [ $_, $relationships->{$_}->{source} ] }
+ sort keys %$relationships;
}
1;
@@ -381,7 +386,7 @@ use parent qw/Catalyst::Controller::DBIC::API::REST/;
sub create :Private {
my ($self, $c) = @_;
$self->next::method($c);
- if ($c->stash->{created_object}) {
+ if ($c->stash->{created_object}) {
%{$c->stash->{response}->{new_object}} = $c->stash->{created_object}->get_columns;
}
}
@@ -397,27 +402,35 @@ use JSON::XS;
use parent qw/[% app %]::ControllerBase::REST/;
__PACKAGE__->config(
+ # Define parent chain action and partpath
action => { setup => { PathPart => '[% class_name %]', Chained => '/api/rest/rest_base' } },
- # define parent chain action and partpath
- class => '[% result_class %]', # DBIC result class
- create_requires => [qw/[% create_requires %]/], # columns required to create
- create_allows => [qw/[% create_allows %]/], # additional non-required columns that create allows
- update_allows => [qw/[% update_allows %]/], # columns that update allows
- list_returns => [qw/[% list_returns %]/], # columns that list returns
+ # DBIC result class
+ class => '[% result_class %]',
+ # Columns required to create
+ create_requires => [qw/[% create_requires %]/],
+ # Additional non-required columns that create allows
+ create_allows => [qw/[% create_allows %]/],
+ # Columns that update allows
+ update_allows => [qw/[% update_allows %]/],
+ # Columns that list returns
+ list_returns => [qw/[% list_returns %]/],
[% IF list_prefetch %]
- list_prefetch => [[% list_prefetch %]], # relationships prefetched by default
+ # relationships prefetched by default
+ list_prefetch => [[% list_prefetch %]],
[% END %]
[% IF list_prefetch_allows %]
- list_prefetch_allows => [ # every possible prefetch param allowed
+ # Every possible prefetch param allowed
+ list_prefetch_allows => [
[% list_prefetch_allows %]
],
[% END %]
- list_ordered_by => [qw/[% list_ordered_by %]/], # order of generated list
+ # Order of generated list
+ list_ordered_by => [qw/[% list_ordered_by %]/],
+ # columns that can be searched on via list
list_search_exposes => [
qw/[% list_search_exposes %]/,
[% sub_list_search_exposes %]
- ], # columns that can be searched on via list
-);
+ ],);
=head1 NAME
View
12 t/lib/DBICTest.pm
@@ -13,12 +13,12 @@ DBICTest - Library to be used by DBIx::Class test scripts.
use lib qw(t/lib);
use DBICTest;
use Test::More;
-
+
my $schema = DBICTest->init_schema();
=head1 DESCRIPTION
-This module provides the basic utilities to write tests against
+This module provides the basic utilities to write tests against
DBIx::Class.
=head1 METHODS
@@ -30,13 +30,13 @@ DBIx::Class.
no_populate=>1,
);
-This method removes the test SQLite database in t/var/DBIxClass.db
+This method removes the test SQLite database in t/var/DBIxClass.db
and then creates a new, empty database.
-This method will call deploy_schema() by default, unless the
+This method will call deploy_schema() by default, unless the
no_deploy flag is set.
-Also, by default, this method will call populate_schema() by
+Also, by default, this method will call populate_schema() by
default, unless the no_deploy or no_populate flags are set.
=cut
@@ -120,7 +120,7 @@ sub clear_schema {
DBICTest->populate_schema( $schema );
-After you deploy your schema you can use this method to populate
+After you deploy your schema you can use this method to populate
the tables with test data.
=cut
View
2 t/lib/RestTest.pm
@@ -1,5 +1,5 @@
package # Hide from PAUSE
- RestTest;
+ RestTest;
use strict;
use warnings;
View
6 t/lib/RestTest/Controller/API/REST/Artist.pm
@@ -18,20 +18,20 @@ __PACKAGE__->config(
list_prefetch_allows => [ # every possible prefetch param allowed
[qw/cds/], { 'cds' => [qw/cd_to_producer tags tracks/] },
-
+
],
list_ordered_by => [qw/artistid/], # order of generated list
list_search_exposes => [
qw/artistid name/,
{ 'cds' => [qw/cdid artist title year/] },
-
+
], # columns that can be searched on via list
);
=head1 NAME
- - REST Controller for
+ - REST Controller for
=head1 DESCRIPTION
View
14 t/lib/RestTest/Controller/API/REST/CD.pm
@@ -18,24 +18,24 @@ __PACKAGE__->config(
list_prefetch_allows => [ # every possible prefetch param allowed
[qw/cd_to_producer/], { 'cd_to_producer' => [qw//] },
- [qw/tags/], { 'tags' => [qw//] },
- [qw/tracks/], { 'tracks' => [qw//] },
-
+ [qw/tags/], { 'tags' => [qw//] },
+ [qw/tracks/], { 'tracks' => [qw//] },
+
],
list_ordered_by => [qw/cdid/], # order of generated list
list_search_exposes => [
qw/cdid artist title year/,
{ 'cd_to_producer' => [qw/cd producer/] },
- { 'tags' => [qw/tagid cd tag/] },
- { 'tracks' => [qw/trackid cd position title last_updated_on/] },
-
+ { 'tags' => [qw/tagid cd tag/] },
+ { 'tracks' => [qw/trackid cd position title last_updated_on/] },
+
], # columns that can be searched on via list
);
=head1 NAME
- - REST Controller for
+ - REST Controller for
=head1 DESCRIPTION
View
10 t/lib/RestTest/Controller/API/REST/CD_to_Producer.pm
@@ -18,21 +18,21 @@ __PACKAGE__->config(
list_prefetch_allows => [ # every possible prefetch param allowed
[qw/cd_to_producer/], { 'cd_to_producer' => [qw//] },
- [qw/tags/], { 'tags' => [qw//] },
- [qw/tracks/], { 'tracks' => [qw//] },
-
+ [qw/tags/], { 'tags' => [qw//] },
+ [qw/tracks/], { 'tracks' => [qw//] },
+
],
list_ordered_by => [qw/cd producer/], # order of generated list
list_search_exposes => [
qw/cd producer/,
-
+
], # columns that can be searched on via list
);
=head1 NAME
- - REST Controller for
+ - REST Controller for
=head1 DESCRIPTION
View
10 t/lib/RestTest/Controller/API/REST/Producer.pm
@@ -18,21 +18,21 @@ __PACKAGE__->config(
list_prefetch_allows => [ # every possible prefetch param allowed
[qw/cd_to_producer/], { 'cd_to_producer' => [qw//] },
- [qw/tags/], { 'tags' => [qw//] },
- [qw/tracks/], { 'tracks' => [qw//] },
-
+ [qw/tags/], { 'tags' => [qw//] },
+ [qw/tracks/], { 'tracks' => [qw//] },
+
],
list_ordered_by => [qw/producerid/], # order of generated list
list_search_exposes => [
qw/producerid name/,
-
+
], # columns that can be searched on via list
);
=head1 NAME
- - REST Controller for
+ - REST Controller for
=head1 DESCRIPTION
View
6 t/lib/RestTest/Controller/API/REST/Tag.pm
@@ -18,19 +18,19 @@ __PACKAGE__->config(
list_prefetch_allows => [ # every possible prefetch param allowed
[qw/cds/], { 'cds' => [qw/cd_to_producer tags tracks/] },
-
+
],
list_ordered_by => [qw/tagid/], # order of generated list
list_search_exposes => [
qw/tagid cd tag/,
-
+
], # columns that can be searched on via list
);
=head1 NAME
- - REST Controller for
+ - REST Controller for
=head1 DESCRIPTION
View
10 t/lib/RestTest/Controller/API/REST/Track.pm
@@ -18,21 +18,21 @@ __PACKAGE__->config(
list_prefetch_allows => [ # every possible prefetch param allowed
[qw/cd_to_producer/], { 'cd_to_producer' => [qw//] },
- [qw/tags/], { 'tags' => [qw//] },
- [qw/tracks/], { 'tracks' => [qw//] },
-
+ [qw/tags/], { 'tags' => [qw//] },
+ [qw/tracks/], { 'tracks' => [qw//] },
+
],
list_ordered_by => [qw/trackid/], # order of generated list
list_search_exposes => [
qw/trackid cd position title last_updated_on/,
-
+
], # columns that can be searched on via list
);
=head1 NAME
- - REST Controller for
+ - REST Controller for
=head1 DESCRIPTION
View
2 t/lib/RestTest/Controller/Root.pm
@@ -38,7 +38,7 @@ sub default : Private {
Attempt to render a view, if needed.
-=cut
+=cut
sub end : Private {}
View
2 t/lib/RestTest/ControllerBase/REST.pm
@@ -8,7 +8,7 @@ use parent qw/Catalyst::Controller::DBIC::API::REST/;
sub create :Private {
my ($self, $c) = @_;
$self->next::method($c);
- if ($c->stash->{created_object}) {
+ if ($c->stash->{created_object}) {
%{$c->stash->{response}->{new_object}} = $c->stash->{created_object}->get_columns;
}
}
View
2 t/lib/RestTest/Schema/Result/Artist.pm
@@ -1,4 +1,4 @@
-package # hide from PAUSE
+package # hide from PAUSE
RestTest::Schema::Result::Artist;
use strict;
View
2 t/lib/RestTest/Schema/Result/CD.pm
@@ -1,4 +1,4 @@
-package # hide from PAUSE
+package # hide from PAUSE
RestTest::Schema::Result::CD;
use strict;
View
2 t/lib/RestTest/Schema/Result/CD_to_Producer.pm
@@ -1,4 +1,4 @@
-package # hide from PAUSE
+package # hide from PAUSE
RestTest::Schema::Result::CD_to_Producer;
use strict;
View
4 t/lib/RestTest/Schema/Result/Producer.pm
@@ -1,4 +1,4 @@
-package # hide from PAUSE
+package # hide from PAUSE
RestTest::Schema::Result::Producer;
use strict;
@@ -15,7 +15,7 @@ __PACKAGE__->add_columns(
'name' => {
data_type => 'varchar',
size => 100,
- default_value => 'fred'
+ default_value => 'fred'
},
);
__PACKAGE__->set_primary_key('producerid');
View
2 t/lib/RestTest/Schema/Result/Tag.pm
@@ -1,4 +1,4 @@
-package # hide from PAUSE
+package # hide from PAUSE
RestTest::Schema::Result::Tag;
use strict;
View
4 t/lib/RestTest/Schema/Result/Track.pm
@@ -1,4 +1,4 @@
-package # hide from PAUSE
+package # hide from PAUSE
RestTest::Schema::Result::Track;
use strict;
@@ -17,7 +17,7 @@ __PACKAGE__->add_columns(
'position' => {
data_type => 'integer',
accessor => 'pos',
- default_value => 0
+ default_value => 0
},
'title' => {
data_type => 'varchar',
View
2 t/lib/RestTest/Schema/ResultSet.pm
@@ -1,4 +1,4 @@
-package # hide from PAUSE
+package # hide from PAUSE
RestTest::Schema::ResultSet;
use strict;

0 comments on commit 147f40d

Please sign in to comment.