From: Matt S Trout Date: Fri, 25 Aug 2006 21:49:09 +0000 (+0000) Subject: fixes to many-many X-Git-Tag: v0.07002~18 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f72f9361dabf3ea6d0a7becb6166319c778dcf4f;p=dbsrgits%2FDBIx-Class.git fixes to many-many --- diff --git a/lib/DBIx/Class/Relationship/ManyToMany.pm b/lib/DBIx/Class/Relationship/ManyToMany.pm index 09cd751..e294a8c 100644 --- a/lib/DBIx/Class/Relationship/ManyToMany.pm +++ b/lib/DBIx/Class/Relationship/ManyToMany.pm @@ -60,9 +60,9 @@ sub many_to_many { @_ > 0 or $self->throw_exception( "{$set_meth} needs a list of objects or hashrefs" ); - my @to_set = (ref($_[0] eq 'ARRAY') ? @{ $_[0] } : @_); + my @to_set = (ref($_[0]) eq 'ARRAY' ? @{ $_[0] } : @_); $self->search_related($rel, {})->delete; - $self->$add_meth(shift) for (@to_set); + $self->$add_meth($_) for (@to_set); }; *{"${class}::${remove_meth}"} = sub {