[Bast-commits] r4419 - DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual

ash at dev.catalyst.perl.org ash at dev.catalyst.perl.org
Tue May 27 11:41:45 BST 2008


Author: ash
Date: 2008-05-27 11:41:44 +0100 (Tue, 27 May 2008)
New Revision: 4419

Modified:
   DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/FAQ.pod
Log:
Update FAQ to mention behavour of scalar refs w.r.t. update

Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/FAQ.pod
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/FAQ.pod	2008-05-27 01:38:39 UTC (rev 4418)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/FAQ.pod	2008-05-27 10:41:44 UTC (rev 4419)
@@ -357,6 +357,19 @@
 
  ->update({ somecolumn => \'othercolumn' })
 
+But note that when using a scalar reference the column in the database
+will be updated but when you read the value from the object with e.g.
+ 
+ ->somecolumn()
+ 
+you still get back the scalar reference to the string, B<not> the new
+value in the database. To get that you must refresh the row from storage
+using C<discard_changes()>. Or chain your function calls like this:
+
+  ->update->discard_changes
+ 
+ to update the database and refresh the object in one step.
+ 
 =item .. store JSON/YAML in a column and have it deflate/inflate automatically?
 
 You can use L<DBIx::Class::InflateColumn> to accomplish YAML/JSON storage transparently.




More information about the Bast-commits mailing list