From: Jess Robinson Date: Wed, 11 Jun 2008 12:54:58 +0000 (+0000) Subject: Add docs to update mentioning scalar refs and discard_changes X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=05d1bc9cfa711bd8ccd83f6e6e1a418b6439f8a9;p=dbsrgits%2FDBIx-Class-Historic.git Add docs to update mentioning scalar refs and discard_changes --- diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index d2def31..ffe0359 100644 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@ -295,6 +295,21 @@ C, which might edit it in place, so dont rely on it being the same after a call to C. If you need to preserve the hashref, it is sufficient to pass a shallow copy to C, e.g. ( { %{ $href } } ) +If the values passed or any of the column values set on the object +contain scalar references, eg: + + $obj->last_modified(\'NOW()'); + # OR + $obj->update({ last_modified => \'NOW()' }); + +The update will pass the values verbatim into SQL. (See +L docs). The values in your Row object will NOT change +as a result of the update call, if you want the object to be updated +with the actual values from the database, call L +after the update. + + $obj->update()->discard_changes(); + =cut sub update {