From: Dagfinn Ilmari Mannsåker Date: Fri, 20 Dec 2013 22:06:29 +0000 (+0000) Subject: Swap order of _relnames_and_method return values X-Git-Tag: 0.07039~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=45b70e6c5450ee7a1428f10dd90dce0a50e45ff4;p=dbsrgits%2FDBIx-Class-Schema-Loader.git Swap order of _relnames_and_method return values It makes more sense to have the local relname first, then the remote relname and method. Note that this plus the previous commit are not a no-op, since the meanings of the names have changed. --- diff --git a/lib/DBIx/Class/Schema/Loader/RelBuilder.pm b/lib/DBIx/Class/Schema/Loader/RelBuilder.pm index 878a5b9..8ae4559 100644 --- a/lib/DBIx/Class/Schema/Loader/RelBuilder.pm +++ b/lib/DBIx/Class/Schema/Loader/RelBuilder.pm @@ -411,7 +411,7 @@ sub generate_code { my %cond; @cond{@$remote_cols} = @$local_cols; - my ( $remote_relname, $local_relname, $remote_method ) = + my ( $local_relname, $remote_relname, $remote_method ) = $self->_relnames_and_method( $local_moniker, $rel, \%cond, $uniqs, \%counters ); my $local_method = 'belongs_to'; @@ -950,7 +950,7 @@ sub _relnames_and_method { } } - return ($remote_relname, $local_relname, $remote_method); + return ($local_relname, $remote_relname, $remote_method); } sub _rel_name_map { 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 5909eed..1910ce1 100644 --- a/lib/DBIx/Class/Schema/Loader/RelBuilder/Compat/v0_040.pm +++ b/lib/DBIx/Class/Schema/Loader/RelBuilder/Compat/v0_040.pm @@ -33,7 +33,7 @@ sub _relnames_and_method { ($remote_relname) = $self->_inflect_plural(lc $local_table); } - return ( $remote_relname, $local_relname, 'has_many' ); + return ( $local_relname, $remote_relname, 'has_many' ); } sub _remote_attrs { } 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 90e6114..c3581e7 100644 --- a/lib/DBIx/Class/Schema/Loader/RelBuilder/Compat/v0_05.pm +++ b/lib/DBIx/Class/Schema/Loader/RelBuilder/Compat/v0_05.pm @@ -61,7 +61,7 @@ sub _relnames_and_method { ($remote_relname) = $self->_inflect_singular($remote_relname_uninflected); } - return ( $remote_relname, $local_relname, $remote_method ); + return ( $local_relname, $remote_relname, $remote_method ); } =head1 NAME