2009/3/5 Pesho Petrov <[email protected]>

>
> Colin Law wrote:
> > That appears to be 5 tables, but I presume that is just a typo.
>
> yes, sorry for the typo.
>
> > What are the has and belongs to relationships?
>
> Member:
> --------
>  has_many  :memberships, :dependent => :destroy
>  has_many  :roles, :dependent => :destroy
>  has_many  :messages, :dependent => :destroy
>
> Group:
> -------
>  has_many :mberships,:dependent => :destroy
>  has_many :messages, :dependent => :destroy
>
> Role:
> ------
>  has_many :memberships, :dependent => :destroy
>  has_many :messages, :dependent => :destroy
>
> Membership:
> ------------
>  belongs_to :member
>  belongs_to :group
>  belongs_to :role
>
> Message:
> -----------
>  belongs_to :member
>  belongs_to :role
>  belongs_to :group
>

Are you sure?  That seems incredibly complex.  For example a member has many
roles, but it also has many memberships, each one of which belongs to a
role, so that is another set of roles a member may have.

Does a message belong to a member, a group and a role or just one of them at
a time?



>
>
>
> :)
>
> --
> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to