From: Alexander Hartmaier Date: Thu, 18 Feb 2010 10:02:05 +0000 (+0100) Subject: Fixed some typos and code cleanups X-Git-Tag: 2.002001~28 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=73517f507669cada16503d144607e42c86b65f64;p=catagits%2FCatalyst-Controller-DBIC-API.git Fixed some typos and code cleanups --- diff --git a/Changes b/Changes index 0652822..2ab8c02 100644 --- a/Changes +++ b/Changes @@ -2,8 +2,8 @@ Revision history for Catalyst-Controller-DBIC-API: {{ $dist->version }} {{ $NEXT }} -- Fixed some typos and code cleanups - Remove debugging code from tests +- Fixed some typos and code cleanups 2.001003 2010-02-12 19:01:56 America/Chicago diff --git a/lib/Catalyst/Controller/DBIC/API.pm b/lib/Catalyst/Controller/DBIC/API.pm index 3f33466..c173dcd 100644 --- a/lib/Catalyst/Controller/DBIC/API.pm +++ b/lib/Catalyst/Controller/DBIC/API.pm @@ -122,7 +122,7 @@ sub object :Chained('setup') :CaptureArgs(1) :PathPart('') unless(defined($vals)) { # no data root, assume the request_data itself is the payload - $vals = [$c->req->request_data || {}]; + $vals = [$c->req->request_data]; } elsif(reftype($vals) eq 'HASH') { @@ -293,7 +293,7 @@ sub inflate_request List level action chained from L. List's steps are broken up into three distinct methods: L, L, and L. -The goal of this method is to call ->search() on the current_result_set, HashRefInflator the result, and return it in $c->stash->{response}->{$self->data_root}. Pleasee see the individual methods for more details on what actual processing takes place. +The goal of this method is to call ->search() on the current_result_set, HashRefInflator the result, and return it in $c->stash->{response}->{$self->data_root}. Please see the individual methods for more details on what actual processing takes place. If the L config param is defined then the hashes will contain only those columns, otherwise all columns in the object will be returned. L of course supports the function/procedure calling semantics that L. In order to have proper column names in the result, provide arguments in L (which also follows L semantics. Similarly L, L, L and L affect the maximum number of rows returned as well as the ordering and grouping. Note that if select, count, ordered_by or grouped_by request parameters are present then these will override the values set on the class with select becoming bound by the select_exposes attribute. diff --git a/lib/Catalyst/Controller/DBIC/API/REST.pm b/lib/Catalyst/Controller/DBIC/API/REST.pm index 740b3a9..474f80d 100644 --- a/lib/Catalyst/Controller/DBIC/API/REST.pm +++ b/lib/Catalyst/Controller/DBIC/API/REST.pm @@ -50,10 +50,7 @@ GET: forwards to L =cut -sub base : Chained('setup') PathPart('') ActionClass('REST') Args { - my ( $self, $c ) = @_; - -} +sub base : Chained('setup') PathPart('') ActionClass('REST') Args {} sub base_PUT { my ( $self, $c ) = @_; diff --git a/lib/Catalyst/Controller/DBIC/API/StaticArguments.pm b/lib/Catalyst/Controller/DBIC/API/StaticArguments.pm index 3ee8ec2..063b75f 100644 --- a/lib/Catalyst/Controller/DBIC/API/StaticArguments.pm +++ b/lib/Catalyst/Controller/DBIC/API/StaticArguments.pm @@ -122,7 +122,7 @@ prefetch_arg controls how to reference 'prefetch' in the the request_data has 'prefetch_arg' => ( is => 'ro', isa => Str, default => 'list_prefetch' ); -=attribute_public data_root is: ro, isa: Str, default: 'listt' +=attribute_public data_root is: ro, isa: Str, default: 'list' data_root controls how to reference where the data is in the the request_data