X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema%2FLoader%2FRelBuilder.pm;h=adc652ae6f21b3ff91458d59f21c21a57c496d69;hb=198a1e711a2610cd3b165669ee23daa641e789f5;hp=72a567ecfee22eb750d98f65862e51fa2d46c4e0;hpb=057fbb08b497a9054b86f00f4c8e47ea0e8feedf;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/lib/DBIx/Class/Schema/Loader/RelBuilder.pm b/lib/DBIx/Class/Schema/Loader/RelBuilder.pm index 72a567e..adc652a 100644 --- a/lib/DBIx/Class/Schema/Loader/RelBuilder.pm +++ b/lib/DBIx/Class/Schema/Loader/RelBuilder.pm @@ -6,7 +6,7 @@ use Class::C3; use Carp::Clan qw/^DBIx::Class/; use Lingua::EN::Inflect::Number (); -our $VERSION = '0.05002'; +our $VERSION = '0.05003'; =head1 NAME @@ -270,20 +270,17 @@ sub _relnames_and_methods { # If more than one rel between this pair of tables, use the local # col names to distinguish my $local_relname; + my $old_multirel_name; #< TODO: remove me if ( $counters->{$remote_moniker} > 1) { my $colnames = q{_} . join(q{_}, @$local_cols); $remote_relname .= $colnames if keys %$cond > 1; - my $old_relname = #< TODO: remove me after 0.05003 release - my $local_relname = lc($local_table) . $colnames; - my $stripped_id = $local_relname =~ s/_id$//; #< strip off any trailing _id + $local_relname = lc($local_table) . $colnames; + $local_relname =~ s/_id$// + #< TODO: remove me + and $old_multirel_name = $self->_inflect_plural( lc($local_table) . $colnames ); $local_relname = $self->_inflect_plural( $local_relname ); - # TODO: remove me after 0.05003 release - $old_relname = $self->_inflect_plural( $old_relname ); - warn __PACKAGE__." $VERSION: warning, stripping trailing _id from ${remote_class} relation '$old_relname', renaming to '$local_relname'. This behavior is new as of 0.05003.\n" - if $stripped_id; - } else { $local_relname = $self->_inflect_plural(lc $local_table); } @@ -298,6 +295,10 @@ sub _relnames_and_methods { $local_relname = $self->_inflect_singular($local_relname); } + # TODO: remove me after 0.05003 release + $old_multirel_name + and warn __PACKAGE__." $VERSION: warning, stripping trailing _id from ${remote_class} relation '$old_multirel_name', renaming to '$local_relname'. This behavior is new as of 0.05003.\n"; + return ( $local_relname, $remote_relname, $remote_method ); }