X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FRelationship%2FAccessor.pm;h=fb15f10535ca83fb7ffd3196aea1f57daa0e7299;hb=ddc0a6c89d212433eb5716b2aa963f63b1f348d1;hp=76183deac2a5b22a37d72c8dc766599b5dd43284;hpb=c959e8d06362537fbc865d703786b399d0806212;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Relationship/Accessor.pm b/lib/DBIx/Class/Relationship/Accessor.pm index 76183de..fb15f10 100644 --- a/lib/DBIx/Class/Relationship/Accessor.pm +++ b/lib/DBIx/Class/Relationship/Accessor.pm @@ -3,6 +3,8 @@ package # hide from PAUSE use strict; use warnings; +use Sub::Name (); +use Class::Inspector (); sub register_relationship { my ($class, $rel, $info) = @_; @@ -57,7 +59,8 @@ sub add_relationship_accessor { no strict 'refs'; no warnings 'redefine'; foreach my $meth (keys %meth) { - *{"${class}::${meth}"} = $meth{$meth}; + my $name = join '::', $class, $meth; + *$name = Sub::Name::subname($name, $meth{$meth}); } } }