[Dbix-class] Re: create_related is failing on second time through loop?

Len Jaffe lenjaffe at jaffesystems.com
Thu Jun 21 20:55:33 GMT 2012


On Thu, Jun 21, 2012 at 4:41 PM, Tim Anderson <tja824 at gmail.com> wrote:

> Thanks for the quick response Ben.
>
> I am indeed setting a 'detail_id =3D> 5' 2 times, but 'against' 2 differe=
nt
> header records.   On loop 1, the primary key for the new detail record is
> 'header_id: 1, detail_id: 5' and on loop 2 it is 'header_id: 2, detail_id:
> 5'.  I probably wasn't clear enough in the last post that the detail table
> has header_id and detail_id as primary keys.
>

It may or may not be your problem, but if detail_id it the primary key of
the detail table then you can't set bot records to have the same ID.

-- =

lenjaffe at jaffesystems.com   614-404-4214             www.volunteerable.net
Proprietor: http://www.theycomewithcheese.com/ - An Homage to Fromage
Greenbar <http://www.greenbartraining.org/>: Grubmaster: 2012-2009, Grub
Asst: 2008, Trained: 2007.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20120621/49f=
467e5/attachment.htm


More information about the DBIx-Class mailing list