On Mon, Oct 01, 2007 at 11:19:18AM +0100, Scott Thomson wrote:
> Hi All,
> 
> In Row::new there is logic for caching newed but not inserted objects
> so that insert can pick them up later and insert them if required.
> 
> Are there any technical/theoretical reasons for not simulating or
> moving the logic into Relationship::Base::new_related?
> 
> E.g. I think the following should work but it currently doesn't ...
> 
> my $obj1 = $schema->resultset('MyApp::Obj1')->new($some_args);
> my $obj2 = $obj1->new_related('rel', $more_args);
> $obj1->insert();
> ok($obj2->in_storage());

I don't think the new_related implies you want it to be inserted when the
other object is.

Setting it as $obj1->rel($obj2) before the insert OTOH, probably does.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]

Reply via email to