Re: Model relationship design question.

Pardee, Roy
2008-05-15T20:16:32Z

Or, since a submission is the product of only one user, you put user_id in
submissions, and then do a many:many between submissions and companies (so you
have a submissions_companies join table w/submission_id and company_id).

-----Original Message-----
From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
[mailto:rubyonrails-talk@googlegroups.com] On Behalf Of Larry
Sent: Thursday, May 15, 2008 1:10 PM
To: Ruby on Rails: Talk
Subject: [Rails] Re: Model relationship design question.


One user (who coincidentally happens to belong to a company) writes an article
about zero or more companies. You will need, in addition to users, submissions,
and companies, a new table (and model) that has all three ids: user_id,
submission_id, and company_id.

On May 14, 11:40 pm, maestro777
<isig...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
> Thanks guys for all the input.
>
> I''m glad to find out that I was on the right track after all from
the
> beginning, with my models set up. It wasn''t that I was having
problem
> getting the result I wanted. Rather the source of my confusion came
> from a misunderstanding on what I was reading in one of the ROR books
> about model relationship. Now that you confirmed I was on the right
> track, I went back to read the same passage again and realized that it
> was talking about a different kind of relationship, than what I had in
> mind.
>
> Thanks again for the help.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com