Hi everybody, I am building some kind of social networking web. I have implemented user registration and now I would like to add another type of registration (authors). I dont know whether to keep the registration simple and add just a checkbox (user and author) and add a new column (user_type) into the existing user table or build a new model Author to manage authors. Thanks for your thoughts. Cheers Petr -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Why does it need to be a type? What makes an author so different to make it different from a common user? - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) On Mon, Dec 15, 2008 at 10:37 AM, Petr Bobek <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi everybody, > > I am building some kind of social networking web. I have implemented > user registration and now I would like to add another type of > registration (authors). I dont know whether to keep the registration > simple and add just a checkbox (user and author) and add a new column > (user_type) into the existing user table or build a new model > Author to manage authors. > > Thanks for your thoughts. > Cheers > Petr > -- > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 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 -~----------~----~----~----~------~----~------~--~---
I was planning to create subdomain for each author, so I want to seperate them from the normal users. Maurício Linhares wrote:> Why does it need to be a type? What makes an author so different to > make it different from a common user?-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 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 -~----------~----~----~----~------~----~------~--~---
Petr Bobek wrote:> I was planning to create subdomain for each author, so I want to > seperate them from the normal users. > > > > Maurício Linhares wrote: >> Why does it need to be a type? What makes an author so different to >> make it different from a common user?You could use a type column, and single table inheritance, but I suggest creating a separate Author model with its own authors table, and have a user_id in that table. This way, an Author belongs_to a User. All author-specific data goes in the authors table, and you can reuse all of your authentication with the User model. Alternatively, users could have an author_id, if that makes more sense. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 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 -~----------~----~----~----~------~----~------~--~---