Skip to content

Commit

Permalink
Swap order of _relnames_and_method return values
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ilmari committed Dec 20, 2013
1 parent d75f8e7 commit 45b70e6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/DBIx/Class/Schema/Loader/RelBuilder.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion lib/DBIx/Class/Schema/Loader/RelBuilder/Compat/v0_040.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 { }
Expand Down
2 changes: 1 addition & 1 deletion lib/DBIx/Class/Schema/Loader/RelBuilder/Compat/v0_05.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 45b70e6

Please sign in to comment.