Re: extra constraints on has_many relationship (patch)

[prev] [thread] [next] [Date index for 2004/10/24]

From: Tony Bowden
Subject: Re: extra constraints on has_many relationship (patch)
Date: 16:08 on 24 Oct 2004
On Tue, Jun 08, 2004 at 04:15:24PM -0400, cees-cdbi@xxxxxxxxxxxxx.xx wrote:
> I would like some comments on a small patch I have attached that will allow
> extra constraints to be included in has_many relationships.  This addition can
> simplify some common situations.
> My::Domains->has_many(users => 'My::Users');
> my @users = $domain->users(active => 1);
>
> My::Domains->has_many(users => 'My::Users');
> My::Domains->has_many(activeusers => 'My::Users', { constraint => [active =>
> 1]);
> my @users = $domain->activeusers();

> I can provide ... a few tests for this feature if there is interest in the idea.

Looks good to me. Tests welcome!

Tony


Re: extra constraints on has_many relationship (patch)
Tony Bowden 16:08 on 24 Oct 2004

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