From: T- Di Date: 2012-08-09T00:27:08+09:00 Subject: Re: Join with ActiveRecord using non-standard schema Finally got it working. Couple of notes for the newbies like me trying to learn: - ClassName is translated to class_name in ActiveRecord. - On each class I had to add also the primary_key to make it work. So here are the corrected models: class AgreementType < ActiveRecord::Base self.table_name = 'AGREEMENT_TYPES' self.primary_key = 'AGREEMENT_TYPE_ID' belongs_to :agreement, :primary_key => :agreement_type_id, :foreign_key => :agreement_type_id end class Agreement < ActiveRecord::Base self.table_name = 'AGREEMENTS' self.primary_key = 'AGREEMENT_ID' has_one :agreement_type, :primary_key => :agreement_type_id, :foreign_key => :agreement_type_id end -- Posted via http://www.ruby-forum.com/.