From: Ash Berlin Date: Fri, 12 Oct 2007 10:32:41 +0000 (+0000) Subject: s/indices/indexes/ to keep Jess happy. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=17cab2f096f05c297fb7cd51fa1502616dabd844;p=dbsrgits%2FDBIx-Class-Historic.git s/indices/indexes/ to keep Jess happy. --- diff --git a/lib/DBIx/Class/ResultSource.pm b/lib/DBIx/Class/ResultSource.pm index 11f2b09..3d06ba9 100644 --- a/lib/DBIx/Class/ResultSource.pm +++ b/lib/DBIx/Class/ResultSource.pm @@ -13,7 +13,7 @@ use base qw/DBIx::Class/; __PACKAGE__->mk_group_accessors('simple' => qw/_ordered_columns _columns _primaries _unique_constraints name resultset_attributes schema from _relationships column_info_from_storage source_info - source_name _indices/); + source_name _indexes/); __PACKAGE__->mk_group_accessors('component_class' => qw/resultset_class result_class/); @@ -55,7 +55,7 @@ sub new { $new->{_relationships} = { %{$new->{_relationships}||{}} }; $new->{name} ||= "!!NAME NOT SET!!"; $new->{_columns_info_loaded} ||= 0; - $new->_indices([]) unless $new->_indices; + $new->_indexes([]) unless $new->_indexes; return $new; } @@ -461,17 +461,17 @@ as L. sub add_index { my ($self, $idx) = @_; - push @{ $self->_indices }, $idx; + push @{ $self->_indexes }, $idx; } -=head2 indicies +=head2 indexes -Returns list of secondary (i.e. non unique) indicies created on this table. +Returns list of secondary (i.e. non unique) indexes created on this table. =cut -sub indices { - return @{ shift->_indices }; +sub indexes { + return @{ shift->_indexes }; } =head2 add_relationship diff --git a/lib/DBIx/Class/ResultSourceProxy.pm b/lib/DBIx/Class/ResultSourceProxy.pm index 2ac1228..65ea6d2 100644 --- a/lib/DBIx/Class/ResultSourceProxy.pm +++ b/lib/DBIx/Class/ResultSourceProxy.pm @@ -108,8 +108,8 @@ sub add_index { shift->result_source_instance->add_index(@_); } -sub indices { - shift->result_source_instance->indices(@_); +sub indexes { + shift->result_source_instance->indexes(@_); } 1; diff --git a/lib/SQL/Translator/Parser/DBIx/Class.pm b/lib/SQL/Translator/Parser/DBIx/Class.pm index a0f37b6..546f773 100644 --- a/lib/SQL/Translator/Parser/DBIx/Class.pm +++ b/lib/SQL/Translator/Parser/DBIx/Class.pm @@ -109,7 +109,7 @@ sub parse { } } - foreach my $idx ( $source->indices ) { + foreach my $idx ( $source->indexes ) { my $ret = $table->add_index(%$idx) or die $table->error; } diff --git a/t/86sqlt.t b/t/86sqlt.t index 7a76f79..c70be74 100644 --- a/t/86sqlt.t +++ b/t/86sqlt.t @@ -214,7 +214,7 @@ my %unique_constraints = ( # ], ); -my %indices = ( +my %indexes = ( artist => [ { 'fields' => ['name'] @@ -253,8 +253,8 @@ for my $expected_constraints (keys %unique_constraints) { } } -for my $table_index (keys %indices) { - for my $expected_index ( @{ $indices{$table_index} } ) { +for my $table_index (keys %indexes) { + for my $expected_index ( @{ $indexes{$table_index} } ) { ok ( get_index($table_index, $expected_index), "Got a matching index on $table_index table"); }