X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema%2FLoader%2FRelBuilder%2FCompat%2Fv0_040.pm;h=2e5cb5446686597a66438cbaf2209eae93dba551;hb=53c4835c7c3e764f0881b196fb29f348916e8411;hp=f97ba9a6a78708151a8a1f147fc68e0ce8ec4ab7;hpb=18eb280f9b71785a12c105299f813358faa47143;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/lib/DBIx/Class/Schema/Loader/RelBuilder/Compat/v0_040.pm b/lib/DBIx/Class/Schema/Loader/RelBuilder/Compat/v0_040.pm index f97ba9a..2e5cb54 100644 --- a/lib/DBIx/Class/Schema/Loader/RelBuilder/Compat/v0_040.pm +++ b/lib/DBIx/Class/Schema/Loader/RelBuilder/Compat/v0_040.pm @@ -5,7 +5,7 @@ use warnings; use base 'DBIx::Class::Schema::Loader::RelBuilder::Compat::v0_05'; use mro 'c3'; -our $VERSION = '0.07018'; +our $VERSION = '0.07040'; sub _relnames_and_method { my ( $self, $local_moniker, $rel, $cond, $uniqs, $counters ) = @_; @@ -17,20 +17,20 @@ sub _relnames_and_method { my $local_cols = $rel->{local_columns}; # for single-column case, set the remote relname to just the column name - my ($remote_relname) = + my ($local_relname) = scalar keys %{$cond} == 1 ? $self->_inflect_singular( values %$cond ) : $self->_inflect_singular( lc $remote_table ); # If more than one rel between this pair of tables, use the local # col names to distinguish - my $local_relname; + my $remote_relname; if ($counters->{$remote_moniker} > 1) { my $colnames = '_' . join( '_', @$local_cols ); - $remote_relname .= $colnames if keys %$cond > 1; - ($local_relname) = $self->_inflect_plural( lc($local_table) . $colnames ); + $local_relname .= $colnames if keys %$cond > 1; + ($remote_relname) = $self->_inflect_plural( lc($local_table) . $colnames ); } else { - ($local_relname) = $self->_inflect_plural(lc $local_table); + ($remote_relname) = $self->_inflect_plural(lc $local_table); } return ( $local_relname, $remote_relname, 'has_many' );