From: Justin Hunter Date: Sat, 19 Sep 2009 16:47:01 +0000 (-0700) Subject: stringify the table object X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0c4b09d0b3e88aeec94c096075f56b88d7410cef;p=dbsrgits%2FSQL-Translator-2.0-ish.git stringify the table object --- diff --git a/lib/SQL/Translator/Object/Table.pm b/lib/SQL/Translator/Object/Table.pm index 785963c..54d28c1 100644 --- a/lib/SQL/Translator/Object/Table.pm +++ b/lib/SQL/Translator/Object/Table.pm @@ -1,9 +1,16 @@ use MooseX::Declare; -class SQL::Translator::Object::Table extends SQL::Translator::Object { +class SQL::Translator::Object::Table extends SQL::Translator::Object is dirty { use MooseX::Types::Moose qw(Any Bool HashRef Str); use MooseX::MultiMethods; use SQL::Translator::Types qw(Column Constraint Index Schema Sequence); - + clean; + + use overload + '""' => sub { shift->name }, + 'bool' => sub { $_[0]->name || $_[0] }, + fallback => 1, + ; + has 'name' => ( is => 'rw', isa => Str,