From: T- Di Date: 2012-08-07T00:38:33+09:00 Subject: Re: Join with ActiveRecord using non-standard schema Hassan Schroeder wrote in post #1071438: > On Mon, Aug 6, 2012 at 7:39 AM, T- Di wrote: > >> @agreements = Agreement.find(:all, :include => :AgreementType) >> @agreements.first.name >> >> Which returned: >> NoMethodError: undefined method `name' for # > > So why did you think "@agr.name" from your first example would do > anything useful if Agreement doesn't have a name method? > > Or is it AgreementType that has a name and that's what you wanted? The table AgreementType contains the field 'name' that I want to use. Quick recap from the first message: - There are 2 tables for which I created individual classes: a. Agreement b. AgreementType - The field 'AGREEMENT_TYPE_ID' is present in both tables, so I can use it to join their contents. - The field 'name' is on the AGREEMENT_TYPE_ID -- Posted via http://www.ruby-forum.com/.