On 8/5/06, John Siracusa <[EMAIL PROTECTED]> wrote:
> I've rearranged the interface to this stuff a little bit in SVN, but
> the results should still take care of your situation.  If you get a
> chance, try the SVN version and let me know if it correctly makes the
> foo->bar relationship "optional" by default.

Mine is dying when you have a completely new object, and you have your
new object to create a new object in the relationship also. It dies
because the relationship object doesn't have the foreign key set.

Consider the following tables:

create table foo ( id serial not null, foo text );
create table bar ( foo_id int not null references foo(id), bar text);

And the code:

my $bar = MyApp::Bar->new;
my $foo = MyApp::Foo->bew;
$foo->bar($bar);
$foo->bar->bar('some text');
$foo->save(cascade => 1);

I will attempt a patch for you tomorrow, but for now it's bed time.

regards,
Danial Pearce

[ Apologies for double post, i sent from the wrong address before and
it bounced. ]

-- 
"Cats are smarter than dogs. You can't get eight cats to pull a sled
through snow." - Jeff Valdez

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to