From: Justin Hunter Date: Tue, 9 Feb 2010 06:21:45 +0000 (-0800) Subject: coerce a Str to ArrayRef X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=59ad6549d4f9af30c7a7e1d0138bf0fb85393865;p=dbsrgits%2FSQL-Translator-2.0-ish.git coerce a Str to ArrayRef --- diff --git a/lib/SQL/Translator/Types.pm b/lib/SQL/Translator/Types.pm index 89dc8cc..6e66ee2 100644 --- a/lib/SQL/Translator/Types.pm +++ b/lib/SQL/Translator/Types.pm @@ -32,6 +32,8 @@ class SQL::Translator::Types { coerce Trigger, from HashRef, via { SQL::Translator::Object::Trigger->new($_) }; coerce View, from HashRef, via { SQL::Translator::Object::View->new($_) }; + coerce ArrayRef, from Str, via { [ $_ ] }; + subtype MatchType, as Str, where { /^(full|partial|simple)$/ || $_ eq '' }; coerce MatchType, from Str, via { lc $_ };