Open SineSwiper opened 12 years ago
( have not looked into this in detail, I am simply doing a pass on all the tickets in the distribution, making sure I am not missing something )
The above likely can be addressed by repurposing this (internal but rather stable) piece of logic: https://metacpan.org/source/RIBASUSHI/DBIx-Class-0.082840/lib/DBIx/Class/ResultSet.pm#L863-899
There often may be cases where a table is bound to an integer id PK, but the "real" key is the name, which is uniquely constrained. And in those cases, you might not know the integer PK. For example:
Thing
already exists, so trying to INSERT this would error. However, DBIC:RS:RU isn't going to find the row, despite given a proper unique key to find it. So, you end up with an uniqueness error because it tries to INSERT it.The
$object
find should look for all keys, not just PKs. I have a partial solution here:This works, but it's flawed in regards to the more complicated test cases. I think this is because the other
primary_column
cases haven't been converted yet. I need help with these because I don't completely understand what they do.On the other hand, I do have a test case written for my problem above (
96multi_create.t
):(The
second create_related
block is the same as the original with the added genre. Thethird create_related
is a new test.)