Forum: Ruby on Rails Join not using FK

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Eb55248214a1c6fdce1d6e6f80d15c2f?d=identicon&s=25 Gabriel Perez (bogea)
on 2006-12-31 00:33
(Received via mailing list)
Hi, I'm trying to make a join not using an FK. For instance:

If a have a Model Person, Phone and Call. A person has many phones.
There's no relationship between Call and Phone. Here are the model
attributes:

Person: name
Phone: number, person_id
Call: number_called, call_date

I want to join Phone and Call by the phone number.

I'd like to do: <%= call.phone.number %>

How can I make this kind of join?
This topic is locked and can not be replied to.