[Bast-commits] r4489 - DBIx-Class/0.08/trunk/lib/DBIx/Class
castaway at dev.catalyst.perl.org
castaway at dev.catalyst.perl.org
Wed Jun 11 13:54:58 BST 2008
Author: castaway
Date: 2008-06-11 13:54:58 +0100 (Wed, 11 Jun 2008)
New Revision: 4489
Modified:
DBIx-Class/0.08/trunk/lib/DBIx/Class/Row.pm
Log:
Add docs to update mentioning scalar refs and discard_changes
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Row.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Row.pm 2008-06-11 12:25:15 UTC (rev 4488)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Row.pm 2008-06-11 12:54:58 UTC (rev 4489)
@@ -295,6 +295,21 @@
the same after a call to C<update>. If you need to preserve the hashref, it is
sufficient to pass a shallow copy to C<update>, 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<SQL::Abstract> 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</discard_changes>
+after the update.
+
+ $obj->update()->discard_changes();
+
=cut
sub update {
More information about the Bast-commits
mailing list