[Catalyst-commits] r8157 - Catalyst-Controller-DBIC-API/1.000/trunk/t/lib/RestTest/Controller/API/REST

jshirley at dev.catalyst.perl.org jshirley at dev.catalyst.perl.org
Wed Jul 23 19:08:20 BST 2008


Author: jshirley
Date: 2008-07-23 19:08:20 +0100 (Wed, 23 Jul 2008)
New Revision: 8157

Added:
   Catalyst-Controller-DBIC-API/1.000/trunk/t/lib/RestTest/Controller/API/REST/BoundArtist.pm
Log:
Adding the missing controller so my tests pass.

Added: Catalyst-Controller-DBIC-API/1.000/trunk/t/lib/RestTest/Controller/API/REST/BoundArtist.pm
===================================================================
--- Catalyst-Controller-DBIC-API/1.000/trunk/t/lib/RestTest/Controller/API/REST/BoundArtist.pm	                        (rev 0)
+++ Catalyst-Controller-DBIC-API/1.000/trunk/t/lib/RestTest/Controller/API/REST/BoundArtist.pm	2008-07-23 18:08:20 UTC (rev 8157)
@@ -0,0 +1,24 @@
+package RestTest::Controller::API::REST::BoundArtist;
+
+use strict;
+use warnings;
+use base qw/RestTest::Controller::API::REST::Artist/;
+use JSON::Syck;
+
+__PACKAGE__->config
+    ( action => { setup => { PathPart => 'bound_artist', Chained => '/api/rest/rest_base' } },
+      class => 'RestTestDB::Artist',
+      setup_list_method => 'filter_search',
+      create_requires => ['name'],
+      create_allows => ['name'],
+      update_allows => ['name']
+      );
+
+# Arbitrary limit
+sub filter_search : Private {
+    my ( $self, $c, $query ) = @_;
+    # Return the first one, regardless of what comes in via params
+    $query->{search}->{'artistid'} = 1;
+}
+
+1;




More information about the Catalyst-commits mailing list