Ruby on Rails Discussions
Two fields associated to the same table
rubyonrails-talk
GoodbyeJava
(GoodbyeJava)
August 8, 2007, 5:23pm
1
you need 2 foriegn keys. Then add the :foriegn_key => :user2_id to has_many and belongs_to
Related topics
Topic
Replies
Views
Activity
Has and belongs to many with a single table
rubyonrails-talk
0
99
June 13, 2007
HABTM foreign keys
rubyonrails-talk
0
191
November 29, 2006
has_many and belongs_to with non-primary foreign keys
rubyonrails-talk
3
148
April 19, 2008
non-"table_id" foreign key
rubyonrails-talk
3
170
November 7, 2006
Tables: Unnecessary duplication of id fields
rubyonrails-talk
0
144
June 30, 2008