1 package DBIx::Class::Schema::Loader::RelBuilder::Compat::v0_040;
5 use base 'DBIx::Class::Schema::Loader::RelBuilder::Compat::v0_05';
8 our $VERSION = '0.07048_01';
10 sub _relnames_and_method {
11 my ( $self, $local_moniker, $rel, $cond, $uniqs, $counters ) = @_;
13 my $remote_moniker = $rel->{remote_source};
14 my $remote_table = $rel->{remote_table};
16 my $local_table = $rel->{local_table};
17 my $local_cols = $rel->{local_columns};
19 # for single-column case, set the remote relname to just the column name
21 scalar keys %{$cond} == 1
22 ? $self->_inflect_singular( values %$cond )
23 : $self->_inflect_singular( lc $remote_table );
25 # If more than one rel between this pair of tables, use the local
26 # col names to distinguish
28 if ($counters->{$remote_moniker} > 1) {
29 my $colnames = '_' . join( '_', @$local_cols );
30 $local_relname .= $colnames if keys %$cond > 1;
31 ($remote_relname) = $self->_inflect_plural( lc($local_table) . $colnames );
33 ($remote_relname) = $self->_inflect_plural(lc $local_table);
36 return ( $local_relname, $remote_relname, 'has_many' );
43 DBIx::Class::Schema::Loader::RelBuilder::Compat::v0_040 - RelBuilder for
44 compatibility with DBIx::Class::Schema::Loader version 0.04006
48 See L<DBIx::Class::Schema::Loader::Base/naming> and
49 L<DBIx::Class::Schema::Loader::RelBuilder>.
53 See L<DBIx::Class::Schema::Loader/AUTHORS>.
57 This library is free software; you can redistribute it and/or modify it under
58 the same terms as Perl itself.