[Dbix-class] find_or_create and unique constraints

Ronald J Kimball rkimball at pangeamedia.com
Mon Oct 4 15:22:49 GMT 2010


On Sat, Oct 2, 2010 at 8:16 PM, Bill Moseley <moseley at hank.org> wrote:

> Seems like ->single (and thus find_or_create) should throw an exception if
> more than one row is returned, columns passed to find_or_create must sati=
sfy
> a defined unique constraint, and if a single row is found any non-constra=
int
> columns specified should be updated.
>

find_or_create() should not update an already existing row.  That's what
update_or_create() is for.

Ronald
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20101004/8d3=
7c016/attachment.htm


More information about the DBIx-Class mailing list