Re: [CDBI] has_many - how to specify link columns ?

Michael Reece <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.class-dbi
Message-ID <[email protected]>
'should not' is a dangerous assumption!  i have found that, since i  
cannot always guarantee the order that the classes are 'used', that i  
get intermittent failures[*] if i rely on the assumptions.  so i've  
developed the habit of _always_ defining the third argument, just to  
be sure me and HasMany agree on what is expected.

[*] - where 'failure' is defined as HasMany assuming the table  
'moniker' as they key, typically due to circular 'use' cases where  
CDBI::One might need to use CDBI::Two and vice versa so i can make  
use of these classes in other methods (not list defining  
relationships).  so CDBI::One may not have set up its has_a before  
CDBI::Two tries to has_many.

On Aug 15, 2006, at 12:47 PM, Ryan Tate wrote:

> On 8/15/06, Michael Reece <[email protected]> wrote:
>>   articles->has_many( prices => 'prive2articles' => 'artid' );  #  
>> third
>> argument is 'my key in foreign table'
>
> The third argument to has_many should not be needed, assuming
> price2articles class properly sets up has_a relationship with articles
> class, i.e.:
>
> $price2articles_class->has_a( artid => $article_class );
> $article_class->has_many( prices => $price2articles_class );
>
> By the way, why not just rename the "price2articles" table "prices?"
> Seems a lot simpler.
>
> _______________________________________________
> ClassDBI mailing list
> ClassDBI-Ra3b/[email protected]
> http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

---
michael reece :: software engineer :: [email protected]

_______________________________________________
ClassDBI mailing list
ClassDBI-Ra3b/[email protected]
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.