X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FCDBICompat%2FRelationships.pm;h=d6120bcf8b2cbb92e115ef9e4fe4b3a73eddf51b;hb=ddc0a6c89d212433eb5716b2aa963f63b1f348d1;hp=0a4b4755db0090e1d8448d804f8a445511ca34a3;hpb=c959e8d06362537fbc865d703786b399d0806212;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/CDBICompat/Relationships.pm b/lib/DBIx/Class/CDBICompat/Relationships.pm index 0a4b475..d6120bc 100644 --- a/lib/DBIx/Class/CDBICompat/Relationships.pm +++ b/lib/DBIx/Class/CDBICompat/Relationships.pm @@ -3,7 +3,7 @@ package # hide from PAUSE use strict; use warnings; - +use Sub::Name (); use base qw/Class::Data::Inheritable/; use Clone; @@ -122,7 +122,8 @@ sub has_many { no strict 'refs'; no warnings 'redefine'; my $post_proc = sub { my $o = shift; $o = $o->$_ for @f_method; $o; }; - *{"${class}::${rel}"} = + my $name = join '::', $class, $rel; + *$name = Sub::Name::subname $name, sub { my $rs = shift->search_related($rel => @_); $rs->{attrs}{record_filter} = $post_proc;