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 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Thu, Apr 28, 2011 at 12:38 PM, santhiya <saru.santhiya-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Thu, Apr 28, 2011 at 12:49 PM, David Kahn <dk-rfEMNHKVqOwNic7Bib+Ti1W1rNmOCjRP@public.gmane.org>wrote:> > > On Thu, Apr 28, 2011 at 12:38 PM, santhiya <saru.santhiya-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>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) >This is of course if I have not totally misunderstood what you are trying to do with your app :) If so, please clarify.> > >> >> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.