From: Rafael Kitover Date: Mon, 22 Feb 2010 09:41:27 +0000 (-0500) Subject: rename _relnames_and_methods to _relnames_and_method in RelBuilder X-Git-Tag: 0.06000~88 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=39ef3bfe4474a3e41e714733f8bcc5db49d40c1f;p=dbsrgits%2FDBIx-Class-Schema-Loader.git rename _relnames_and_methods to _relnames_and_method in RelBuilder --- diff --git a/lib/DBIx/Class/Schema/Loader/RelBuilder.pm b/lib/DBIx/Class/Schema/Loader/RelBuilder.pm index d88564a..092ed5c 100644 --- a/lib/DBIx/Class/Schema/Loader/RelBuilder.pm +++ b/lib/DBIx/Class/Schema/Loader/RelBuilder.pm @@ -100,6 +100,8 @@ sub new { sub _inflect_plural { my ($self, $relname) = @_; + return '' if !defined $relname || $relname eq ''; + if( ref $self->{inflect_plural} eq 'HASH' ) { return $self->{inflect_plural}->{$relname} if exists $self->{inflect_plural}->{$relname}; @@ -116,6 +118,8 @@ sub _inflect_plural { sub _inflect_singular { my ($self, $relname) = @_; + return '' if !defined $relname || $relname eq ''; + if( ref $self->{inflect_singular} eq 'HASH' ) { return $self->{inflect_singular}->{$relname} if exists $self->{inflect_singular}->{$relname}; @@ -224,7 +228,7 @@ sub generate_code { } my ( $local_relname, $remote_relname, $remote_method ) = - $self->_relnames_and_methods( $local_moniker, $rel, \%cond, $uniqs, \%counters ); + $self->_relnames_and_method( $local_moniker, $rel, \%cond, $uniqs, \%counters ); push(@{$all_code->{$local_class}}, { method => 'belongs_to', @@ -256,7 +260,7 @@ sub generate_code { return $all_code; } -sub _relnames_and_methods { +sub _relnames_and_method { my ( $self, $local_moniker, $rel, $cond, $uniqs, $counters ) = @_; my $remote_moniker = $rel->{remote_source}; 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 f96ba8a..d329e63 100644 --- a/lib/DBIx/Class/Schema/Loader/RelBuilder/Compat/v0_040.pm +++ b/lib/DBIx/Class/Schema/Loader/RelBuilder/Compat/v0_040.pm @@ -6,7 +6,7 @@ use Class::C3; use base 'DBIx::Class::Schema::Loader::RelBuilder'; -sub _relnames_and_methods { +sub _relnames_and_method { my ( $self, $local_moniker, $rel, $cond, $uniqs, $counters ) = @_; my $remote_moniker = $rel->{remote_source};