Still looking for help on this one. I submitted it late Friday night
(EST), so wanted to bump it for the Monday morning crowd. The full text
is below.
Thanks.
Chris Bloom wrote:> I''m planning out an application that will involve creating tickets
and
> assigning one or more staff to handle them, but I have a question about
> the correct way to structure the relationships in Activerecord
>
> The application is made up of Members and Staff, which are subtypes of
> an STI User model. Either type of user can create a Ticket, but only
> Staff can be assigned to them.
>
> Here''s what I have so far, but I''m not sure if it created
an infinite
> loop
>
> User::Member
> has_many :tickets
>
> User::Staff
> has_many :tickets
> has_many :tickets through :ticket_assignments
>
> Ticket
> belongs_to :user
> has_many :staff through :ticket_assignments
>
> TicketAssignment
> belongs_to :ticket
> belongs_to :staff
>
> I have a feeling that the STI model for both User types is going to be
> the kink in the chain. Should I break it out? Is there another way to
> model this? Should I go with a habtm join instead?
>
> Thanks!
--
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
-~----------~----~----~----~------~----~------~--~---