2009/3/5 Pesho Petrov <[email protected]> > > Colin Law wrote: > > Am I right in thinking that the member/group combination for a message > > is > > always the same member/group that appears in a membership record? If so > > then would it be better to have > > > > Membership: > > has_many :messages > > belongs_to :member > > belongs_to :group > > belongs_to :role > > > > and > > > > Message: > > belongs_to :membership > > > > you are right. Then should I remove the member_id and group_id fields > from table Messages, and substitute them with a field membership_id? >
Yes. The question is, of course, has any of this helped with your original question? I think it has as you can now find all messages where the membership.role_id is admin and membership.member_id is the member you want > > :) > -- > Posted via http://www.ruby-forum.com/. > > > > --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

