From: Arthur Axel "fREW" Schmidt Date: Sat, 30 Jan 2010 20:19:30 +0000 (+0000) Subject: clarify PK stuff in intro just a bit X-Git-Tag: v0.08121~83^2~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=63ec970588bb3199b8c390d12473f370fa4f9d6f;p=dbsrgits%2FDBIx-Class.git clarify PK stuff in intro just a bit --- diff --git a/lib/DBIx/Class/Manual/Intro.pod b/lib/DBIx/Class/Manual/Intro.pod index 5d7c48b..5325fa0 100644 --- a/lib/DBIx/Class/Manual/Intro.pod +++ b/lib/DBIx/Class/Manual/Intro.pod @@ -430,6 +430,18 @@ L, L, L +For example, the following would not work: + + my $row = $schema->resultset('People') + ->search({ last_name => 'Dantes' }) + ->first; + $row->update({ children => 2 }); # <-- exception thrown because $row isn't + # necessarily unique + +So instead the following should be done: + + $schema->resultset('People')->search({ last_name => 'Dantes' }) + ->update({ children => 2 }); # <-- update's ALL Dantes to have children of 2 =head2 Problems on RHEL5/CentOS5