my $columns = $self->_columns;
while (my $col = shift @cols) {
- my $column_info = ref $cols[0] ? shift : {};
+ my $column_info = ref $cols[0] ? shift(@cols) : {};
# If next entry is { ... } use that for the column info, if not
# use an empty hashref
$columns->{$col} = $column_info;
}
push @{ $self->_ordered_columns }, @added;
+ return $self;
}
*add_column = \&add_columns;
=head2 primary_columns
Read-only accessor which returns the list of primary keys.
-
+
=cut
sub primary_columns {
attrs => $attrs };
$self->_relationships(\%rels);
- return 1;
+ return $self;
# XXX disabled. doesn't work properly currently. skip in tests.
use base 'DBIx::Class::Core';
DBICTest::Schema::Artist->table('artist');
-DBICTest::Schema::Artist->add_columns(qw/artistid name/);
+DBICTest::Schema::Artist->add_columns('artistid', {}, 'name');
DBICTest::Schema::Artist->set_primary_key('artistid');
__PACKAGE__->mk_classdata('field_name_for', {