Displaying 1 result from an estimated 1 matches for "article_user".
2006 Apr 10
1
How to set foreignkey in such a situation?
Table articles has column: author,body,etc
Table users has column: login_name,email,etc
articles belongs_to user
users has many articles
foreign_key author references users(login_name)
Therefore in Article.rb:
belongs_to:article_user,
:class_name=>"User",
:foreign_key=>"author"
and what''s going on? how the rails find the reference relationship
between articules(author) and users(login_name)?
--
Posted via http://www.ruby-forum.com/.