Ruby on Rails Thursday, April 28, 2011



On Thu, Apr 28, 2011 at 12:38 PM, santhiya <saru.santhiya@gmail.com> wrote:
Hi,

Can anybody suggest me better relationship among the above model. so that i can connect message model with other ones.

I have four model like

1.User model - To store the user email and password
2.Actor model
3.Director model
4. Fans model
5. Message Model

I think you need to add a Production or Play model:

User has many Plays
Play has one Director
Play has many Actors
Play has many Fans
User has many Messages
Play has many Messages (depending how you want to do messages and what they mean it could be User has many messages through Plays... or something else)
 

Actor, Director and Fans is used to store the profile information of the user.

Relationship goes like this
User has_one Actor
User has_one Director
User has_one Fans

Message model is for mailing purpose like gmail or yahoo mail.

I have related the user model with message as
User has_many sendermessage and receiver message.



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

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

No comments:

Post a Comment