From: Ike Date: 2006-11-01T05:20:15+09:00 Subject: Re: Syntax q on ActiveRecord "Mike Harris" wrote in message news:4547AC2E.9020102@prodigy.net... > Ike wrote: > Using the column names primary_associate_id and secondary_associate_id, > instead of associatekey1 and associatekey2 > > class Customer < ActiveRecord::Base > belongs_to :primary_associate, :class_name => 'Associate', :foreign_key > => 'primary_associate_id' > belongs_to :secondary_associate, :class_name => 'Associate', :foreign_key > => 'secondary_associate_id' > end > > Rails automatically infers the class_name and foreign_key from the name of > your association. You can always just name your association whatever you > want and specify those things explicitly, like I do here. Thanks Mike, I'm stuck with legacy DB column names here however -- I think maybe I need to look deeper into the ActiveRecord source. Thanks for your help. -Ike