[CDBI] Re: has_a relationship with non-primary column?

Perrin Harkins perrin at elem.com
Sat Sep 8 03:12:27 BST 2007


On 9/7/07, Edward J. Sabol <sabol at alderaan.gsfc.nasa.gov> wrote:
> If I'm correctly understanding what the original poster is asking, then I've
> run into this more often than I would like as well. might_have() can sort of
> do this, right?

It's not really the same thing.  The might_have relationship means
that the other class stores a foreign key back to this class, just
like has_many.  The has_a relationship means this class stores a
foreign key to the other.

If you want a custom relationship to do this, I suspect you could make
it just by copying HasA and hacking it a little.

- Perrin



More information about the ClassDBI mailing list