X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FRelationship%2FManyToMany.pm;h=417c65d4ff3bab3aea6bac77d54b876325f606ee;hb=3bd6e3e0f621c4fe3d7562827a9b86ee5b91cbf2;hp=8b29bf4ffc06c860fd3f9cc6f90c45ba615ea361;hpb=303cf522b1c2841ecab3056cfbb4314fa05151a2;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Relationship/ManyToMany.pm b/lib/DBIx/Class/Relationship/ManyToMany.pm index 8b29bf4..417c65d 100644 --- a/lib/DBIx/Class/Relationship/ManyToMany.pm +++ b/lib/DBIx/Class/Relationship/ManyToMany.pm @@ -35,8 +35,10 @@ sub many_to_many { my $obj = ref $_[0] ? ( ref $_[0] eq 'HASH' ? $f_rel_rs->create($_[0]) : $_[0] ) : ( $f_rel_rs->create({@_}) ); + my $link_vals = @_ > 1 && ref $_[$#_] eq 'HASH' ? pop(@_) : {}; my $link = $self->search_related($rel)->new_result({}); $link->set_from_related($f_rel, $obj); + $link->set_columns($link_vals); $link->insert(); };