On 10/10/07, George Hartzell <[EMAIL PROTECTED]> wrote: > Well, if I want to return a copy of the object, complete with the new > value for the counter, I've taken to: > > my $id = $new_num->id(); > $new_num = undef; > $new_num = RoR::DB::SampleSheetNumber->new(id => $id); > $new_num->load(); > > It occurs to me that there might be a $new_num->reload(), or that > $new_num->load on an already loaded object might be guaranteed to not > do something silly, or....
You can safely load() to "refresh" the object with new values from the db. There's no need to make a new object (unless you have some custom, non-db attributes that you've added yourself, in which case you should override load() and take whatever action you deem appropriate for those attributes.) -John ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Rose-db-object mailing list Rose-db-object@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rose-db-object