On 7 November 2011 08:51, Colin Law <clan...@googlemail.com> wrote:
> On 6 November 2011 22:48, Philippe M. <li...@ruby-forum.com> wrote:
>> I agree with your answer.
>> But technically i still need to find my way.
>
> I believe Scott is suggesting that you just have one class, User or
> Person or Company or whatever is appropriate, and put all the
> necessary data to allow them to be sellers, buyers or both in that one
> table.  I believe that is what I would do.  The simplest solution is
> often the best.

Yup, I'd be looking at a Person/Company model (or Client, or whatever
your main description is of who makes the trades), and then have a
Sale model which has an associated Buyer and Seller (which both link
to the same Person/Company/Client model.

If you want to know who all the Buyers are, have a named scope on
P/C/C to return all those who are associated to Sales as Buyers, and
vice versa for Seller.

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to