X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema%2FLoader%2FRelBuilder%2FCompat%2Fv0_040.pm;h=2a6859d653c420eea5860a3a915591630a089644;hb=6bb8fa3c45e71b384cd8217753152fd13381431a;hp=cc2653c9b28a3d830889749e77ee0b165127bd7e;hpb=53ef681d0209e2c85ddd60e049e3c8510fb27bb5;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/lib/DBIx/Class/Schema/Loader/RelBuilder/Compat/v0_040.pm b/lib/DBIx/Class/Schema/Loader/RelBuilder/Compat/v0_040.pm index cc2653c..2a6859d 100644 --- a/lib/DBIx/Class/Schema/Loader/RelBuilder/Compat/v0_040.pm +++ b/lib/DBIx/Class/Schema/Loader/RelBuilder/Compat/v0_040.pm @@ -2,29 +2,22 @@ package DBIx::Class::Schema::Loader::RelBuilder::Compat::v0_040; use strict; use warnings; -use Class::C3; +use base 'DBIx::Class::Schema::Loader::RelBuilder::Compat::v0_05'; +use mro 'c3'; -use base 'DBIx::Class::Schema::Loader::RelBuilder'; - -sub _default_relationship_attrs { +{} } - -sub _to_PL { - my ($self, $name) = @_; - - return Lingua::EN::Inflect::Number::to_PL($name); -} +our $VERSION = '0.07013'; sub _relnames_and_method { my ( $self, $local_moniker, $rel, $cond, $uniqs, $counters ) = @_; my $remote_moniker = $rel->{remote_source}; - my $remote_table = $self->{schema}->source( $remote_moniker )->from; + my $remote_table = $rel->{remote_table}; - my $local_table = $self->{schema}->source($local_moniker)->from; + my $local_table = $rel->{local_table}; my $local_cols = $rel->{local_columns}; # for single-column case, set the remote relname to just the column name - my $remote_relname = + my ($remote_relname) = scalar keys %{$cond} == 1 ? $self->_inflect_singular( values %$cond ) : $self->_inflect_singular( lc $remote_table ); @@ -35,9 +28,9 @@ sub _relnames_and_method { if ($counters->{$remote_moniker} > 1) { my $colnames = '_' . join( '_', @$local_cols ); $remote_relname .= $colnames if keys %$cond > 1; - $local_relname = $self->_inflect_plural( lc($local_table) . $colnames ); + ($local_relname) = $self->_inflect_plural( lc($local_table) . $colnames ); } else { - $local_relname = $self->_inflect_plural(lc $local_table); + ($local_relname) = $self->_inflect_plural(lc $local_table); } return ( $local_relname, $remote_relname, 'has_many' ); @@ -45,8 +38,6 @@ sub _relnames_and_method { sub _remote_attrs { } -1; - =head1 NAME DBIx::Class::Schema::Loader::RelBuilder::Compat::v0_040 - RelBuilder for @@ -54,6 +45,18 @@ compatibility with DBIx::Class::Schema::Loader version 0.04006 =head1 DESCRIPTION -See L. +See L and +L. + +=head1 AUTHOR + +See L and L. + +=head1 LICENSE + +This library is free software; you can redistribute it and/or modify it under +the same terms as Perl itself. =cut + +1;