From: nperez Date: Thu, 11 Feb 2010 03:37:41 +0000 (-0600) Subject: Add more coercions to some types so we can specify more complex sorting behavior X-Git-Tag: 2.001003~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Controller-DBIC-API.git;a=commitdiff_plain;h=1bd2d315dc09738f2cf53c73f29e3dd7d20aefeb Add more coercions to some types so we can specify more complex sorting behavior --- diff --git a/lib/Catalyst/Controller/DBIC/API/Types.pm b/lib/Catalyst/Controller/DBIC/API/Types.pm index 3632e83..bf413f6 100644 --- a/lib/Catalyst/Controller/DBIC/API/Types.pm +++ b/lib/Catalyst/Controller/DBIC/API/Types.pm @@ -38,7 +38,7 @@ Coerces Str. =cut subtype OrderedBy, as Maybe[ArrayRef[Str|HashRef|ScalarRef]]; -coerce OrderedBy, from Str, via { [$_] }; +coerce OrderedBy, from Str, via { [$_] }, from HashRef, via { [$_] }; =type SelectColumns as Maybe[ArrayRef[Str|HashRef]] @@ -49,7 +49,7 @@ Coerces Str. =cut subtype SelectColumns, as Maybe[ArrayRef[Str|HashRef]]; -coerce SelectColumns, from Str, via { [$_] }; +coerce SelectColumns, from Str, via { [$_] }, from HashRef, via { [$_] }; =type SearchParameters as Maybe[ArrayRef[HashRef]]