X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema%2FLoader%2FRelBuilder%2FCompat%2Fv0_05.pm;h=9e932d62144e7df39f83c1f9e0d19d6764b4f5e1;hb=306bf770bf08b06f92863808b1938f2fc704acb0;hp=2aa148e9dc5d77d537bcf483f761d27d1f6d633f;hpb=5fc335ab21e8dcf1ddbc9801a8486e6c613bc643;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/lib/DBIx/Class/Schema/Loader/RelBuilder/Compat/v0_05.pm b/lib/DBIx/Class/Schema/Loader/RelBuilder/Compat/v0_05.pm index 2aa148e..9e932d6 100644 --- a/lib/DBIx/Class/Schema/Loader/RelBuilder/Compat/v0_05.pm +++ b/lib/DBIx/Class/Schema/Loader/RelBuilder/Compat/v0_05.pm @@ -8,7 +8,7 @@ use DBIx::Class::Schema::Loader::Utils 'array_eq'; use namespace::clean; use Lingua::EN::Inflect::Number (); -our $VERSION = '0.07015'; +our $VERSION = '0.07047'; sub _to_PL { my ($self, $name) = @_; @@ -30,25 +30,25 @@ sub _relnames_and_method { my $remote_moniker = $rel->{remote_source}; my $remote_obj = $self->{schema}->source( $remote_moniker ); my $remote_class = $self->{schema}->class( $remote_moniker ); - my $remote_relname = $self->_remote_relname( $rel->{remote_table}, $cond); + my $local_relname = $self->_local_relname( $rel->{remote_table}, $cond); my $local_cols = $rel->{local_columns}; my $local_table = $rel->{local_table}; # If more than one rel between this pair of tables, use the local # col names to distinguish - my ($local_relname, $local_relname_uninflected); + my ($remote_relname, $remote_relname_uninflected); if ( $counters->{$remote_moniker} > 1) { my $colnames = lc(q{_} . join(q{_}, map lc($_), @$local_cols)); - $remote_relname .= $colnames if keys %$cond > 1; + $local_relname .= $colnames if keys %$cond > 1; - $local_relname = lc($local_table) . $colnames; + $remote_relname = lc($local_table) . $colnames; - $local_relname_uninflected = $local_relname; - ($local_relname) = $self->_inflect_plural( $local_relname ); + $remote_relname_uninflected = $remote_relname; + ($remote_relname) = $self->_inflect_plural( $remote_relname ); } else { - $local_relname_uninflected = lc $local_table; - ($local_relname) = $self->_inflect_plural(lc $local_table); + $remote_relname_uninflected = lc $local_table; + ($remote_relname) = $self->_inflect_plural(lc $local_table); } my $remote_method = 'has_many'; @@ -58,7 +58,7 @@ sub _relnames_and_method { if (array_eq([ $local_source->primary_columns ], $local_cols) || grep { array_eq($_->[1], $local_cols) } @$uniqs) { $remote_method = 'might_have'; - ($local_relname) = $self->_inflect_singular($local_relname_uninflected); + ($remote_relname) = $self->_inflect_singular($remote_relname_uninflected); } return ( $local_relname, $remote_relname, $remote_method ); @@ -74,9 +74,9 @@ compatibility with DBIx::Class::Schema::Loader version 0.05003 See L and L. -=head1 AUTHOR +=head1 AUTHORS -See L and L. +See L. =head1 LICENSE