From: Robert Buels Date: Sat, 20 Feb 2010 07:15:06 +0000 (-0800) Subject: fixed relnames in _id strip warning, much easier with simplified code X-Git-Tag: 0.06000~90^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=684f9580ed2ac6aa4005c7f567ef6b55988b426e;p=dbsrgits%2FDBIx-Class-Schema-Loader.git fixed relnames in _id strip warning, much easier with simplified code --- diff --git a/lib/DBIx/Class/Schema/Loader/RelBuilder.pm b/lib/DBIx/Class/Schema/Loader/RelBuilder.pm index de0e9e8..882c569 100644 --- a/lib/DBIx/Class/Schema/Loader/RelBuilder.pm +++ b/lib/DBIx/Class/Schema/Loader/RelBuilder.pm @@ -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 $local_relname = lc($local_table) . $colnames; - my $stripped_id = $local_relname =~ s/_id$//; #< strip off any trailing _id + $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 ); }