Skip Menu |
 

This queue is for tickets about the DBIx-Class CPAN distribution.

Report information
The Basics
Id: 124501
Status: new
Priority: 0/
Queue: DBIx-Class

People
Owner: Nobody in particular
Requestors: silby [...] uw.edu
tsibley [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.082841
Fixed in: (no value)



Subject: Implementation of add_to_foo method for many-to-many relationships is dangerous
Download (untitled) / with headers
text/plain 686b
The implementation¹ of the add_to_foo method for many-to-many relationships is dangerous, as it performs a find_or_create when given a hashref instead of just a create like the add_to_foo methods of other relationships. The documentation² indicates that it should be just a create. Even if this is the desired behaviour and the documentation needs updating, that find_or_create is located in a place where it's impossible to pass in a second argument to specify a unique constraint to use for find. ¹ https://github.com/Perl5/DBIx-Class/blob/maint/0.0828xx/lib/DBIx/Class/Relationship/ManyToMany.pm#L94-L102 ² https://metacpan.org/pod/DBIx::Class::Relationship::Base#add_to_$rel


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.