ruben.pierich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2008-Apr-04 20:14 UTC
Design question REST join table.
Hello, I''m currently designing a rails application using REST principles. I have an employee table, subservices table, and employees_subservices join table. Should I create a resource called employee_subservices or is there another design approach I can take? Thanks, Ruben --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
ruben.pierich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> Hello, > > I''m currently designing a rails application using REST principles. I > have an employee table, subservices table, and employees_subservices > join table. Should I create a resource called employee_subservices or > is there another design approach I can take? > > Thanks, > RubenI think that would depend on whether you want a simple "has and belongs to many" where the join table (employee_subservices) is little more than employee_id subservice_id or a fuller table with those IDs and some other information as well. If so, google "habtm with attributes" or something like that. I also track who and when on everything, so even my join tables are at a minimum employee_id subservice_id created_at created_by updated_at updated_by <additional fields as required> and I use whatever name makes sense to me. I have users, teams, and memberships (my join table)... not team_users. -- 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 -~----------~----~----~----~------~----~------~--~---
ruben.pierich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2008-Apr-05 15:50 UTC
Re: Design question REST join table.
Thanks, I finally decided to go with a resource for my employees_subservices table and all is working fine. Ruben On Apr 4, 4:56 pm, Ar Chron <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> ruben.pier...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: > > Hello, > > > I''m currently designing a rails application using REST principles. I > > have an employee table, subservices table, and employees_subservices > > join table. Should I create a resource called employee_subservices or > > is there another design approach I can take? > > > Thanks, > > Ruben > > I think that would depend on whether you want a simple "has and belongs > to many" where the join table (employee_subservices) is little more than > > employee_id > subservice_id > > or a fuller table with those IDs and some other information as well. If > so, google "habtm with attributes" or something like that. I also track > who and when on everything, so even my join tables are at a minimum > > employee_id > subservice_id > created_at > created_by > updated_at > updated_by > <additional fields as required> > > and I use whatever name makes sense to me. I have users, teams, and > memberships (my join table)... not team_users. > -- > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---