Re: Problem with empty has_a
[prev]
[thread]
[next]
[Date index for 2005/05/20]
>>>>> "Thomas" == Thomas Klausner <domm@xxx.xx> writes:
Thomas> Here's what I'm trying to do:
Thomas> - I have a bunch of events.
Thomas> - I have another bunch of publications.
Thomas> - A publication might be releated to a single event (e.g. a paper of a
Thomas> presentation given at an event).
Thomas> - An event might have several publications releated to it.
Thomas> - Provide links between both events and publications.
Thomas> My initial plan was:
Thomas> My::Publication->has_a(event=>'My::Event');
Thomas> My::Event->has_many(publications=>'My::Publications'=>'event');
Thomas> This worked, but every publication had an empty event (as in my original
Thomas> posting)
Well, this should permit event => undef as well as event => $some_event.
Are you sure you had an "empty" event, and just an undef?
The underlying table permits NULLs there, right?
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@xxxxxxxxxx.xxx> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!