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

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

From: Tony Bowden
Subject: Re: Can we make might_have() relationships easier to use?
Date: 07:46 on 08 Jun 2004
On Tue, Jun 08, 2004 at 03:23:18AM -0400, Edward J. Sabol wrote:
> I suppose a developer could always override the all_columns() method to make
> 'All' be whatever is desired?

Well, you can always do things like that, but it's not really ideal.

> 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?

This is a possibility.

> 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.

We already have that. It's columns_in in Class::DBI::ColumnGrouper.

	my @columns = $class->__grouper->columns_in(qw/All TEMP might_have/);

Yes, it involves calling a double underscored method. We could either
promote that to a normal documented method, or provide a documented
wrapper around it...

Tony

(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?
Tony Bowden 07:46 on 08 Jun 2004

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