belongs_to <parent name>, :foreign_key modifier not work

Wes Gamble wrote:

Oy vey!!!

OK, if it helps someone later, you have to specify a non-standard foreign_key column between a parent and it's child on BOTH sides of the association.

So, in the child, do:

belongs_to :parent_object_name, :foreign_key => 'X'

and in the parent, do:

has_many :child_object_name, :foreign_key => 'X'

Oy vey, indeed!

I have a similar problem, with the complication that the tables in question don't belong to me, I'm just reporting off of them.

Table Products:   No real key/id field. Uniquified off of string "Product"

Table Versions:   No real key/id field.   Has foreign-key pointer to products, but field is called "program." Sure, whatever. :\

I'm having a heck of a time setting up my models' belongs_to and has_many lines. Can someone give me the syntax?

Thanks!