From: Dagfinn Ilmari Mannsåker Date: Fri, 20 Dec 2013 19:11:40 +0000 (+0000) Subject: Re-wrap and re-indent for readability and consistency X-Git-Tag: 0.07039~11 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=edf3eb3948266e8e324da57a9b1cc9ecfb5c4a3f;p=dbsrgits%2FDBIx-Class-Schema-Loader.git Re-wrap and re-indent for readability and consistency --- diff --git a/lib/DBIx/Class/Schema/Loader/RelBuilder.pm b/lib/DBIx/Class/Schema/Loader/RelBuilder.pm index 7383eec..c463b77 100644 --- a/lib/DBIx/Class/Schema/Loader/RelBuilder.pm +++ b/lib/DBIx/Class/Schema/Loader/RelBuilder.pm @@ -417,11 +417,23 @@ sub generate_code { $self->_relnames_and_method( $local_moniker, $rel, \%cond, $uniqs, \%counters ); my $local_method = 'belongs_to'; - ($remote_relname) = $self->_rel_name_map($remote_relname, $local_method, $local_class, $local_moniker, $local_cols, $remote_class, $remote_moniker, $remote_cols); - ($local_relname) = $self->_rel_name_map($local_relname, $remote_method, $remote_class, $remote_moniker, $remote_cols, $local_class, $local_moniker, $local_cols); + ($remote_relname) = $self->_rel_name_map( + $remote_relname, $local_method, + $local_class, $local_moniker, $local_cols, + $remote_class, $remote_moniker, $remote_cols, + ); + ($local_relname) = $self->_rel_name_map( + $local_relname, $remote_method, + $remote_class, $remote_moniker, $remote_cols, + $local_class, $local_moniker, $local_cols, + ); - $remote_relname = $self->_resolve_relname_collision($local_moniker, $local_cols, $remote_relname); - $local_relname = $self->_resolve_relname_collision($remote_moniker, $remote_cols, $local_relname); + $remote_relname = $self->_resolve_relname_collision( + $local_moniker, $local_cols, $remote_relname, + ); + $local_relname = $self->_resolve_relname_collision( + $remote_moniker, $remote_cols, $local_relname, + ); my $rel_attrs_params = { rel_name => $remote_relname, @@ -434,20 +446,20 @@ sub generate_code { remote_cols => $remote_cols, }; - push(@{$all_code->{$local_class}}, - { method => $local_method, - args => [ $remote_relname, - $remote_class, - \%cond, - $self->_remote_attrs($local_moniker, $local_cols, $rel->{attrs}, $rel_attrs_params), - ], - extra => { - local_class => $local_class, - local_moniker => $local_moniker, - remote_moniker => $remote_moniker, - }, - } - ); + push @{$all_code->{$local_class}}, { + method => $local_method, + args => [ + $remote_relname, + $remote_class, + \%cond, + $self->_remote_attrs($local_moniker, $local_cols, $rel->{attrs}, $rel_attrs_params), + ], + extra => { + local_class => $local_class, + local_moniker => $local_moniker, + remote_moniker => $remote_moniker, + }, + }; my %rev_cond = reverse %cond; for (keys %rev_cond) { @@ -466,20 +478,20 @@ sub generate_code { remote_cols => $local_cols, }; - push(@{$all_code->{$remote_class}}, - { method => $remote_method, - args => [ $local_relname, - $local_class, - \%rev_cond, - $self->_relationship_attrs($remote_method, {}, $rel_attrs_params), - ], - extra => { - local_class => $remote_class, - local_moniker => $remote_moniker, - remote_moniker => $local_moniker, - }, - } - ); + push @{$all_code->{$remote_class}}, { + method => $remote_method, + args => [ + $local_relname, + $local_class, + \%rev_cond, + $self->_relationship_attrs($remote_method, {}, $rel_attrs_params), + ], + extra => { + local_class => $remote_class, + local_moniker => $remote_moniker, + remote_moniker => $local_moniker, + }, + }; } }