On 8/5/07, Ricardo SIGNES <[EMAIL PROTECTED]> wrote: > Okay, at this point I looked at the docs and decided to try using "with" > > $group->load(with => 'groups'); > > @u = $group->users; > is(@u, 1); # hooray! > > ...except when I was about to cheer about this on IRC, I noticed that I'd said > "with => 'groups'" and there *is* no "groups" relationship. I had meant to > write "with => 'users'" but flubbed. It seems like even this works: > > $group->load(with => 1);
This is a side effect of the different way that load(with => ...) (re)loads an object, vs. a plain load(). I'm not sure which behavior shouldbe changed. Opinions? I should add some error checking for the "with" args I suppose (the "with" arg is supposed to be "a reference to an array of foreign key or relationship names" according to the docs). Anyway, to cause a related setof objects to be reloaded, just set it to undef: @u = $group->users; ... # time passes, group users change $group->users(undef); # will reload users on next call @u - $group->users; # new set of users loaded This is documented in the method-maker class that makes the relationship methods (see links from the "method map" in each relationship doc). -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