From: Alastair McGowan-Douglas Date: Wed, 28 Mar 2012 20:38:39 +0000 (+0200) Subject: Make a deprecation warning when calling set_$rel with a list. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=21d351b1ceafe4e93135ef93871f2d330de25e63;p=dbsrgits%2FDBIx-Class-Historic.git Make a deprecation warning when calling set_$rel with a list. --- diff --git a/lib/DBIx/Class/Relationship/ManyToMany.pm b/lib/DBIx/Class/Relationship/ManyToMany.pm index a6bedc5..b68e54c 100644 --- a/lib/DBIx/Class/Relationship/ManyToMany.pm +++ b/lib/DBIx/Class/Relationship/ManyToMany.pm @@ -115,6 +115,10 @@ EOW "{$set_meth} needs a list of objects or hashrefs" ); my @to_set = (ref($_[0]) eq 'ARRAY' ? @{ $_[0] } : @_); + ref $_[0] eq 'ARRAY' or warn + "Calling $set_meth with a list of objects is deprecated" + . " - please use an arrayref instead."; + # if there is a where clause in the attributes, ensure we only delete # rows that are within the where restriction if ($rel_attrs && $rel_attrs->{where}) {