X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FRelationship%2FManyToMany.pm;h=451e43501b18ba99678e0b1685f00f6c64dd9455;hb=35210a5deb760654793d66a8b8f49fa360745d12;hp=1e6b93b87830944807f6a90740671b9d5ee3136b;hpb=b42719999e1f415e8a57046bc976622922671c8d;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/Relationship/ManyToMany.pm b/lib/DBIx/Class/Relationship/ManyToMany.pm index 1e6b93b..451e435 100644 --- a/lib/DBIx/Class/Relationship/ManyToMany.pm +++ b/lib/DBIx/Class/Relationship/ManyToMany.pm @@ -24,6 +24,13 @@ sub many_to_many { my $set_meth = "set_${meth}"; my $rs_meth = "${meth}_rs"; + for ($add_meth, $remove_meth, $set_meth, $rs_meth) { + warn "***************************************************************************\n". + "The many-to-many relationship $meth is trying to create a utility method called $_. This will overwrite the existing method on $class. You almost certainly want to rename your method or the many-to-many relationship, as your method will not be callable (it will use the one from the relationship instead.) YOU HAVE BEEN WARNED\n". + "***************************************************************************\n" + if $class->can($_); + } + $rel_attrs->{alias} ||= $f_rel; *{"${class}::${meth}_rs"} = sub {