Patch to add :primary_key option to has_many and has_one associations

Hey all. I'm pimping for a patch that my colleague, Andre Arko, submitted originally:

http://rails.lighthouseapp.com/projects/8994/tickets/292-add-has_many-primary_key-option

I extended it to work with has_one associations, too. We have a couple instances in our app where we need an association that isn't keyed off the default primary key of the model. This patch allows you to use for the association.

Cheers,

-b

This sounds like a good feature, but isn't "primary_key" a confusing
choice of names for that option? What about "alternate_key"?
-hume.

Yeah, I was thinking that myself. What about just :key?

-b