Re: column aliases in has_a / has_many

[prev] [thread] [next] [Date index for 2005/02/01]

From: Aaron Trevena
Subject: Re: column aliases in has_a / has_many
Date: 11:14 on 01 Feb 2005
On Tue, 25 Jan 2005 15:08:45 +0000, Aaron Trevena
<aaron.trevena@xxxxx.xxx> wrote:
> I am porting bugzilla to CDBI and was hoping I could alias some of the
> more ugly column names used in has_a and has_many relationships
> without resorting to set_sql (which I will have to use heavily as it
> is).

Right, aliasing has_a/many is trivial with '*{$accessor_name} =
&preferred_subname; '
so no need for set_sql or any other hackery, but a hack nonetheless.
Looking at the wiki, it is clear there is some kind of wish for it.

Currently I don't have time, but I plan to rework the has_many
relationship module I wrote to offer more options and flexibility
maybe calling it C::D::Relationship::HasManyEnhanced or something to
handy many-to-many tables more elegantly and provide aliasing and
fetching foreign objects by key, etc.

Any suggestions for the name, features, behaviour or test cases would
be appreciated.
 
cheers,

A.

column aliases in has_a / has_many
Aaron Trevena 15:08 on 25 Jan 2005

Re: column aliases in has_a / has_many
Aaron Trevena 11:14 on 01 Feb 2005

Generated at 16:36 on 28 Jul 2005 by mariachi v0.52