X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSQL%2FTranslator%2FSchema%2FTable.pm;h=c09468e42d20d6c58eef695a8cc7b805f9af7bc2;hb=eb3b8ae474d92cc69f0108627c2a5a77c27b6461;hp=a263cee58dacd20ad978a2e0e52f29e575527d4d;hpb=88b8377e76b5e04d61e1111a478c0f8d747b0312;p=dbsrgits%2FSQL-Translator.git diff --git a/lib/SQL/Translator/Schema/Table.pm b/lib/SQL/Translator/Schema/Table.pm index a263cee..c09468e 100644 --- a/lib/SQL/Translator/Schema/Table.pm +++ b/lib/SQL/Translator/Schema/Table.pm @@ -1,7 +1,7 @@ package SQL::Translator::Schema::Table; # ---------------------------------------------------------------------- -# $Id: Table.pm,v 1.7 2003-06-06 22:36:09 kycl4rk Exp $ +# $Id: Table.pm,v 1.12 2003-08-20 16:08:13 kycl4rk Exp $ # ---------------------------------------------------------------------- # Copyright (C) 2003 Ken Y. Clark # @@ -50,7 +50,7 @@ use SQL::Translator::Schema::Index; use base 'Class::Base'; use vars qw( $VERSION $FIELD_ORDER ); -$VERSION = 1.00; +$VERSION = sprintf "%d.%02d", q$Revision: 1.12 $ =~ /(\d+)\.(\d+)/; # ---------------------------------------------------------------------- sub init { @@ -263,12 +263,23 @@ all the comments joined on newlines. =cut - my $self = shift; - push @{ $self->{'comments'} }, @_ if @_; + my $self = shift; + my @comments = ref $_[0] ? @{ $_[0] } : @_; + + for my $arg ( @comments ) { + $arg = $arg->[0] if ref $arg; + push @{ $self->{'comments'} }, $arg if defined $arg && $arg; + } - return wantarray - ? @{ $self->{'comments'} || [] } - : join( "\n", @{ $self->{'comments'} || [] } ); + if ( @{ $self->{'comments'} || [] } ) { + return wantarray + ? @{ $self->{'comments'} } + : join( "\n", @{ $self->{'comments'} } ) + ; + } + else { + return wantarray ? () : undef; + } } # ----------------------------------------------------------------------