Re: Can we make might_have() relationships easier to use?

[prev] [thread] [next] [Date index for 2004/06/08]

From: Edward J. Sabol
Subject: Re: Can we make might_have() relationships easier to use?
Date: 07:23 on 08 Jun 2004
Ed Sabol wrote:
>> One more thing: I was thinking that the columns('All') object method should
>> also return any columns imported by a might_have() relationship. What do you
>> think? (Or is there some other way of getting the complete list of
>> accessors?)

Tony replied:
> Hmmm. Interesting.
>
> Coupled with the similar requests for it to include TEMP columns,
> I think we need to come up with another way of doing all this. There are
> too many things for 'All' to mean :)

I suppose a developer could always override the all_columns() method to make
'All' be whatever is desired?

> I'll toss it around in my head for a while. Suggestions welcome!

Well, to start with, how about implementing a 'might_have' column group so
that $class->columns('might_have') would return just the columns imported by
might_have() relationships?

Here's kind of a wacky idea: Change the columns() method to return the union
of multiple column groups when the argument is a list of column groups
separated by plus signs. E.g., $class->columns('All+TEMP') would return the
'All' columns plus the TEMP columns. Basically, do a split /\+/ and then loop
over the array of column groups and eliminate any duplicates in the array of
return values. Then, in order to get the whole kitchen sink list of columns,
one could call $class->columns('All+TEMP+might_have') or some permuatation
thereof.

(message missing)

Can we make might_have() relationships easier to use?
Edward J. Sabol 06:04 on 04 Jun 2004

Re: Can we make might_have() relationships easier to use?
Edward J. Sabol 07:23 on 08 Jun 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52