• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /macosx-10.9.5/CPANInternal-140/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/RelBuilder/Compat/
1package DBIx::Class::Schema::Loader::RelBuilder::Compat::v0_040;
2
3use strict;
4use warnings;
5use Class::C3;
6
7use base 'DBIx::Class::Schema::Loader::RelBuilder';
8
9sub _uniq_fk_rel {
10    my ($self, $local_moniker, $local_relname, $local_cols, $uniqs) = @_;
11
12    return ('has_many', $local_relname);
13}
14
15sub _remote_attrs { }
16
17sub _remote_relname {
18    my ($self, $remote_table, $cond) = @_;
19
20    my $remote_relname;
21    # for single-column case, set the remote relname to the column
22    # name, to make filter accessors work
23    if(scalar keys %{$cond} == 1) {
24        $remote_relname = $self->_inflect_singular(values %{$cond});
25    }
26    else {
27        $remote_relname = $self->_inflect_singular(lc $remote_table);
28    }
29
30    return $remote_relname;
31}
32
33sub _multi_rel_local_relname {
34    my ($self, $remote_class, $local_table, $local_cols) = @_;
35
36    my $colnames = q{_} . join(q{_}, @$local_cols);
37    my $local_relname = $self->_inflect_plural( lc($local_table) . $colnames );
38
39    return $local_relname;
40}
41
421;
43
44=head1 NAME
45
46DBIx::Class::Schema::Loader::RelBuilder::Compat::v0_040 - RelBuilder for
47compatibility with DBIx::Class::Schema::Loader version 0.04006
48
49=head1 DESCRIPTION
50
51See L<DBIx::Class::Schema::Loader::Base/naming>.
52
53=cut
54