Re: Model relationship design question.

maestro777
2008-05-14T23:54:27Z

Thanks Ryan for your input.
I thought over you have suggested, and I think it doesn''t quite work
for the case that I have.

Let me try to explain my scenario again.

I have a table of companies. Each company has multiple users.
Each user can submit one or more articles.
Each article is about a company (that exists in the company table) and
that company may or may not be the same company that the user
(submitting the article) belongs to.

For example.
I have a User1 who belongs to Company A. He creates an article
submission about Company B.

How do I link the submission to Company B, since the article is about
company B?. Using the has_many :through => users  as you have
suggested, I believe it will link the submission to Company A instead.

Maybe the model I am using to approach the problem may not be correct.
I am open to learning a better approach to this type of scenario.

Thanks again