Re: extra constraints on has_many relationship (patch)

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

From: cees-cdbi
Subject: Re: extra constraints on has_many relationship (patch)
Date: 17:21 on 09 Jun 2004
Quoting "Edward J. Sabol" <sabol@xxxxxxxx.xxxx.xxxx.xxx>:

> > Of course there are probably other ways to achieve the above
> > results, but this seems to me like a simple and clean way of
> > handling a common situation.
> >
> > Comments/Questions?
> 
> Seems pretty useful to me. Semantically speaking though, wouldn't it make
> more sense for the constraint to be a hash reference than an array
> reference?
> The code could/should accept both, but I would document it as a hash
> reference.

Sure.  It doesn't really matter to me either way, and might make it clearer in
the docs.  The only (minor) benefit I can see for using an arrayref is that you
can then control the execution order of the constraints in the SQL statement
for databases where that may affect query optimizations.  But that is only
relevant if you have multiple constraints...

I can provide an updated patch with those doc changes, as well as a few tests
for this feature if there is interest in the idea.

Cheers,

Cees

Re: extra constraints on has_many relationship (patch)
cees-cdbi 17:21 on 09 Jun 2004

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