use sub::name to fix compat with moose method modifiers
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / CDBICompat / Relationship.pm
index ba84843..880ffc2 100644 (file)
@@ -3,7 +3,7 @@ package
 
 use strict;
 use warnings;
-
+use Sub::Name ();
 
 =head1 NAME
 
@@ -20,6 +20,7 @@ my %method2key = (
     class           => 'self_class',
     accessor        => 'accessor',
     foreign_class   => 'class',
+    args            => 'args',
 );
 
 sub new {
@@ -35,13 +36,7 @@ for my $method (keys %method2key) {
     };
     
     no strict 'refs';
-    *{$method} = $code;
-}
-
-sub args {
-    warn "args() is unlikely to ever work";
-    return undef;
+    *{$method} = Sub::Name::subname $method, $code;
 }
 
-
 1;