fix POD coverage and t/backcompat/0.04006/23dumpmore.t
[dbsrgits/DBIx-Class-Schema-Loader.git] / lib / DBIx / Class / Schema / Loader / RelBuilder / Compat / v0_040.pm
1 package DBIx::Class::Schema::Loader::RelBuilder::Compat::v0_040;
2
3 use strict;
4 use warnings;
5 use Class::C3;
6
7 use base 'DBIx::Class::Schema::Loader::RelBuilder';
8
9 sub _uniq_fk_rel {
10     my ($self, $local_moniker, $local_relname, $local_cols, $uniqs) = @_;
11
12     return ('has_many', $local_relname);
13 }
14
15 sub _remote_attrs { }
16
17 sub _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
33 1;
34
35 =head1 NAME
36
37 DBIx::Class::Schema::Loader::RelBuilder::Compat::v0_040 - RelBuilder for
38 compatibility with DBIx::Class::Schema::Loader version 0.04006
39
40 =head1 DESCRIPTION
41
42 Loaded by L<DBIx::Class::Schema::Loader::Compat::v0_040>.
43
44 =cut