Re: [CDBI] Redefine has_many relationship

[prev] [thread] [next] [Date index for 2005/09/18]

From: Matt S Trout
Subject: Re: [CDBI] Redefine has_many relationship
Date: 14:21 on 18 Sep 2005
On Sat, Sep 17, 2005 at 10:01:01PM -0400, Christopher H. Laco wrote:
> Matt S Trout wrote:
> >On Sat, Sep 17, 2005 at 03:34:43PM -0400, Christopher H. Laco wrote:
> >
> >>What's the solution to this?
> >
> >
> >1) E-mail Tony Bowden and hope he's in a good mood
> >2) Switch to DBIx::Class which doesn't suffer from this fuckup in the first
> >   place.
> >
> 
> I'll take this with a few grains of salt because I know you. :-)
> 
> With that said, if you're going to troll the CDBI list, try and do a 
> little more than "fsck0Rs CDBI, use DBIC". :-)

That isn't a troll; Class::DBI's refusal to override things in subclasses
is IMO a complete pain, and something that's shot me in the foot many a
time. Admittedly, DBIC's implementation lets you shoot you in the head if you
want to, but at least it does what it's told :)
 
> Now, for the solution [for me]:
> 
> >    undef(*_items);
> >    undef(*add_to__items);
> >    __PACKAGE__->has_many(_items => $item_class, 'cart');
> 
> 
> That's is the original cart class. Apparently I was trying too hard with 
> encantations of *CustomCart::_items and $__PACKAGE__::_items...

Kinda cute, although I worry you're not undef'ing the methods in the package
you think you are - if it's superclass methods it's worrying about overriding
then surely that won't clear them. Are you adding methods to the class you
think you're adding them to?

        -- 
             Matt S Trout       Specialists in perl consulting, web development, and
  Technical Director    UNIX/Linux systems architecture and automation. Mail
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +

_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

[CDBI] Redefine has_many relationship
Christopher H. Laco 19:34 on 17 Sep 2005

Re: [CDBI] Redefine has_many relationship
Matt S Trout 01:56 on 18 Sep 2005

Re: [CDBI] Redefine has_many relationship
Christopher H. Laco 02:01 on 18 Sep 2005

Re: [CDBI] Redefine has_many relationship
Matt S Trout 14:21 on 18 Sep 2005

Re: [CDBI] Redefine has_many relationship
Christopher H. Laco 14:18 on 18 Sep 2005

Generated at 17:55 on 28 Sep 2005 by mariachi v0.52