I have a "ports" model I wanted to make polymorphic. I have an alarm table that has a port, and I also have a circuits model that has 2 ports. Is there a way to use the circuits model as polymorphic with 2 ports each one a different port? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
anybody? On Mar 9, 7:33 pm, Me <chabg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have a "ports" model I wanted to makepolymorphic. I have an alarm > table that has a port, and I also have a circuits model that has 2 > ports. > > Is there a way to use the circuits model aspolymorphicwith 2 ports > each one a different port?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Chris Habgood wrote:> anybody?It sounds like you will have to use an intermediate table that the circuits model will have a one-many relationship with and then use ports polymorphically in that intermediate table. -- 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 -~----------~----~----~----~------~----~------~--~---
Is there an easier way to implement this? Maybe other than polymorphic? I have a circuits table that has 2 ports. What is the easiest way to do this? On Tue, Mar 10, 2009 at 11:20 PM, Sj Tib <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>wrote:> > Chris Habgood wrote: > > anybody? > > It sounds like you will have to use an intermediate table that the > circuits model will have a one-many relationship with and then use ports > polymorphically in that intermediate table. > -- > 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 -~----------~----~----~----~------~----~------~--~---