In my meta setup for one object, I have the following:
relationships => [
suspended => {
class => 'Donhost::Server::Dedicated::Suspended',
column_map => { server => 'server' },
type => 'one to one',
required => 0,
},
],
And when I try to delete the corresponding object in there:
$self->delete_suspended;
diag Dumper($self->suspended);
I still have a Donhost::Server::Dedicated::Suspended object in there.
I thought, "maybe I need to save it first":
$self->delete_suspended;
$self->save;
diag Dumper($self->suspended);
Nope:
not ok 5 - cannot_reinitialize died (No foreign key named 'suspended' at
/usr/local/lib/perl5/site_perl/5.8.7/Rose/DB/Object.pm line 539 ...
# eval {...} called at
/usr/local/lib/perl5/site_perl/5.8.7/Rose/DB/Object.pm line 478
# Rose::DB::Object::save() called at lib/Donhost/Server/Dedicated.pm
line 563
As you can see, the error is thrown when I call 'save'. However, it complains
about a missing foreign key, even though I thought "relationships" are supposed
to be used when we don't have foreign keys. I've tried reading through the
docs and the tests on this, but no luck.
This is Rose::DB::Object 0.764.
Cheers,
Ovid
--
Buy the book -- http://www.oreilly.com/catalog/perlhks/
Perl and CGI -- http://users.easystreet.com/ovid/cgi_course/
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Rose-db-object mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rose-db-object