X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FCDBICompat%2FRelationships.pm;h=d6120bcf8b2cbb92e115ef9e4fe4b3a73eddf51b;hb=47752afea0272e7382c9649086ae63652b94a2fa;hp=0a4b4755db0090e1d8448d804f8a445511ca34a3;hpb=c79bd6e9b40607d08e41879ecad0804c38bf14dc;p=dbsrgits%2FDBIx-Class.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;