Bumping version to 1.61
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Schema / Table.pm
index ee92158..f2ff231 100644 (file)
@@ -20,7 +20,7 @@ C<SQL::Translator::Schema::Table> is the table object.
 =cut
 
 use Moo;
-use SQL::Translator::Utils qw(parse_list_arg ex2err throw);
+use SQL::Translator::Utils qw(parse_list_arg ex2err throw carp_ro);
 use SQL::Translator::Types qw(schema_obj);
 use SQL::Translator::Role::ListAttr;
 use SQL::Translator::Schema::Constants;
@@ -34,7 +34,7 @@ use Sub::Quote qw(quote_sub);
 
 extends 'SQL::Translator::Schema::Object';
 
-our $VERSION = '1.59';
+our $VERSION = '1.61';
 
 # Stringify to our name, being careful not to pass any args through so we don't
 # accidentally set it to undef. We also have to tweak bool so the object is
@@ -405,7 +405,7 @@ all the comments joined on newlines.
 
 has comments => (
     is => 'rw',
-    coerce => sub { ref($_[0]) eq 'ARRAY' ? $_[0] : [$_[0]] },
+    coerce => quote_sub(q{ ref($_[0]) eq 'ARRAY' ? $_[0] : [$_[0]] }),
     default => quote_sub(q{ [] }),
 );
 
@@ -442,7 +442,7 @@ sub get_constraints {
     }
     else {
         $self->error('No constraints');
-        return wantarray ? () : undef;
+        return;
     }
 }
 
@@ -464,7 +464,7 @@ sub get_indices {
     }
     else {
         $self->error('No indices');
-        return wantarray ? () : undef;
+        return;
     }
 }
 
@@ -515,7 +515,7 @@ sub get_fields {
     }
     else {
         $self->error('No fields');
-        return wantarray ? () : undef;
+        return;
     }
 }
 
@@ -549,6 +549,8 @@ True if table has no data (non-key) fields and only uses single key joins.
 
 has is_trivial_link => ( is => 'lazy', init_arg => undef );
 
+around is_trivial_link => carp_ro('is_trivial_link');
+
 sub _build_is_trivial_link {
     my $self = shift;
     return 0 if $self->is_data;
@@ -577,6 +579,8 @@ Returns true if the table has some non-key fields.
 
 has is_data => ( is => 'lazy', init_arg => undef );
 
+around is_data => carp_ro('is_data');
+
 sub _build_is_data {
     my $self = shift;
 
@@ -737,7 +741,7 @@ add to the fields of an existing PK (and will unique the field names).
 Returns the C<SQL::Translator::Schema::Constraint> object representing
 the primary key.
 
-These are eqivalent:
+These are equivalent:
 
   $table->primary_key('id');
   $table->primary_key(['name']);
@@ -791,8 +795,8 @@ These are eqivalent:
 
 =head2 options
 
-Get or set the table's options (e.g., table types for MySQL).  Returns
-an array or array reference.
+Get or append to the table's options (e.g., table types for MySQL).
+Returns an array or array reference.
 
   my @options = $table->options;
 
@@ -841,7 +845,7 @@ sub field_names {
     }
     else {
         $self->error('No fields');
-        return wantarray ? () : undef;
+        return;
     }
 }